Alexandre Lision | 7c6f4a6 | 2013-09-05 13:27:01 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com> |
| 4 | # |
| 5 | # All rights reserved. |
| 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without |
| 8 | # modification, are permitted provided that the following conditions are |
| 9 | # met: |
| 10 | # |
| 11 | # * Redistributions of source code must retain the above copyright |
| 12 | # notice, this list of conditions and the following disclaimer. |
| 13 | # * Redistributions in binary form must reproduce the above copyright |
| 14 | # notice, this list of conditions and the following disclaimer in |
| 15 | # the documentation and/or other materials provided with the |
| 16 | # distribution. |
| 17 | # * Neither the author nor the names of any contributors may be used |
| 18 | # to endorse or promote products derived from this software without |
| 19 | # specific prior written permission. |
| 20 | # |
| 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
| 23 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 24 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 25 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 26 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 27 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 28 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 29 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 31 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | |
| 33 | |
| 34 | HOST_TRIPLET=x86_64-unknown-linux-gnu |
| 35 | PACKAGE_VERSION=1.0.25 |
| 36 | LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"` |
| 37 | |
| 38 | if test -f tests/sfversion ; then |
| 39 | cd tests |
| 40 | fi |
| 41 | |
| 42 | if test ! -f sfversion ; then |
| 43 | echo "Not able to find test executables." |
| 44 | exit 1 |
| 45 | fi |
| 46 | |
| 47 | if test -f libsndfile.so.$LIB_VERSION ; then |
| 48 | # This will work on Linux, but not on Mac. |
| 49 | # Windows is already sorted out. |
| 50 | export LD_LIBRARY_PATH=`pwd` |
| 51 | if test ! -f libsndfile.so.1 ; then |
| 52 | ln -s libsndfile.so.$LIB_VERSION libsndfile.so.1 |
| 53 | fi |
| 54 | fi |
| 55 | |
| 56 | sfversion=`./sfversion | sed "s/-exp$//"` |
| 57 | |
| 58 | if test $sfversion != libsndfile-$PACKAGE_VERSION ; then |
| 59 | echo "Error : sfversion ($sfversion) and PACKAGE_VERSION ($PACKAGE_VERSION) don't match." |
| 60 | exit 1 |
| 61 | fi |
| 62 | |
| 63 | # Force exit on errors. |
| 64 | set -e |
| 65 | |
| 66 | # Generic-tests |
| 67 | uname -a |
| 68 | |
| 69 | # Check the header file. |
| 70 | sh pedantic-header-test.sh |
| 71 | |
| 72 | # Need this for when we're running from files collected into the |
| 73 | # libsndfile-testsuite-1.0.25 tarball. |
| 74 | if test -x test_main ; then |
| 75 | echo "Running unit tests from src/ directory of source code tree." |
| 76 | ./test_main |
| 77 | echo |
| 78 | echo "Running end-to-end tests from tests/ directory." |
| 79 | fi |
| 80 | |
| 81 | ./error_test |
| 82 | ./pcm_test |
| 83 | ./ulaw_test |
| 84 | ./alaw_test |
| 85 | ./dwvw_test |
| 86 | ./command_test ver |
| 87 | ./command_test norm |
| 88 | ./command_test format |
| 89 | ./command_test peak |
| 90 | ./command_test trunc |
| 91 | ./command_test inst |
| 92 | ./command_test current_sf_info |
| 93 | ./command_test bext |
| 94 | ./command_test bextch |
| 95 | ./command_test chanmap |
| 96 | ./floating_point_test |
| 97 | ./checksum_test |
| 98 | ./scale_clip_test |
| 99 | ./headerless_test |
| 100 | ./rdwr_test |
| 101 | ./locale_test |
| 102 | ./win32_ordinal_test |
| 103 | ./external_libs_test |
| 104 | ./format_check_test |
| 105 | |
| 106 | # The w64 G++ compiler requires an extra runtime DLL which we don't have, |
| 107 | # so skip this test. |
| 108 | case "$HOST_TRIPLET" in |
| 109 | x86_64-w64-mingw32) |
| 110 | ;; |
| 111 | i686-w64-mingw32) |
| 112 | ;; |
| 113 | *) |
| 114 | ./cpp_test |
| 115 | ;; |
| 116 | esac |
| 117 | |
| 118 | echo "----------------------------------------------------------------------" |
| 119 | echo " $sfversion passed common tests." |
| 120 | echo "----------------------------------------------------------------------" |
| 121 | |
| 122 | # aiff-tests |
| 123 | ./write_read_test aiff |
| 124 | ./lossy_comp_test aiff_ulaw |
| 125 | ./lossy_comp_test aiff_alaw |
| 126 | ./lossy_comp_test aiff_gsm610 |
| 127 | echo "==========================" |
| 128 | echo "./lossy_comp_test aiff_ima" |
| 129 | echo "==========================" |
| 130 | ./peak_chunk_test aiff |
| 131 | ./header_test aiff |
| 132 | ./misc_test aiff |
| 133 | ./string_test aiff |
| 134 | ./multi_file_test aiff |
| 135 | ./aiff_rw_test |
| 136 | echo "----------------------------------------------------------------------" |
| 137 | echo " $sfversion passed tests on AIFF files." |
| 138 | echo "----------------------------------------------------------------------" |
| 139 | |
| 140 | # au-tests |
| 141 | ./write_read_test au |
| 142 | ./lossy_comp_test au_ulaw |
| 143 | ./lossy_comp_test au_alaw |
| 144 | ./lossy_comp_test au_g721 |
| 145 | ./lossy_comp_test au_g723 |
| 146 | ./header_test au |
| 147 | ./misc_test au |
| 148 | ./multi_file_test au |
| 149 | echo "----------------------------------------------------------------------" |
| 150 | echo " $sfversion passed tests on AU files." |
| 151 | echo "----------------------------------------------------------------------" |
| 152 | |
| 153 | # caf-tests |
| 154 | ./write_read_test caf |
| 155 | ./lossy_comp_test caf_ulaw |
| 156 | ./lossy_comp_test caf_alaw |
| 157 | ./header_test caf |
| 158 | ./peak_chunk_test caf |
| 159 | ./misc_test caf |
| 160 | echo "----------------------------------------------------------------------" |
| 161 | echo " $sfversion passed tests on CAF files." |
| 162 | echo "----------------------------------------------------------------------" |
| 163 | |
| 164 | # wav-tests |
| 165 | ./write_read_test wav |
| 166 | ./lossy_comp_test wav_pcm |
| 167 | ./lossy_comp_test wav_ima |
| 168 | ./lossy_comp_test wav_msadpcm |
| 169 | ./lossy_comp_test wav_ulaw |
| 170 | ./lossy_comp_test wav_alaw |
| 171 | ./lossy_comp_test wav_gsm610 |
| 172 | ./lossy_comp_test wav_g721 |
| 173 | ./peak_chunk_test wav |
| 174 | ./header_test wav |
| 175 | ./misc_test wav |
| 176 | ./string_test wav |
| 177 | ./multi_file_test wav |
| 178 | echo "----------------------------------------------------------------------" |
| 179 | echo " $sfversion passed tests on WAV files." |
| 180 | echo "----------------------------------------------------------------------" |
| 181 | |
| 182 | # w64-tests |
| 183 | ./write_read_test w64 |
| 184 | ./lossy_comp_test w64_ima |
| 185 | ./lossy_comp_test w64_msadpcm |
| 186 | ./lossy_comp_test w64_ulaw |
| 187 | ./lossy_comp_test w64_alaw |
| 188 | ./lossy_comp_test w64_gsm610 |
| 189 | ./header_test w64 |
| 190 | ./misc_test w64 |
| 191 | echo "----------------------------------------------------------------------" |
| 192 | echo " $sfversion passed tests on W64 files." |
| 193 | echo "----------------------------------------------------------------------" |
| 194 | |
| 195 | # rf64-tests |
| 196 | ./write_read_test rf64 |
| 197 | ./header_test rf64 |
| 198 | ./misc_test rf64 |
| 199 | echo "----------------------------------------------------------------------" |
| 200 | echo " $sfversion passed tests on RF64 files." |
| 201 | echo "----------------------------------------------------------------------" |
| 202 | |
| 203 | # raw-tests |
| 204 | ./write_read_test raw |
| 205 | ./lossy_comp_test raw_ulaw |
| 206 | ./lossy_comp_test raw_alaw |
| 207 | ./lossy_comp_test raw_gsm610 |
| 208 | ./lossy_comp_test vox_adpcm |
| 209 | ./raw_test |
| 210 | echo "----------------------------------------------------------------------" |
| 211 | echo " $sfversion passed tests on RAW (header-less) files." |
| 212 | echo "----------------------------------------------------------------------" |
| 213 | |
| 214 | # paf-tests |
| 215 | ./write_read_test paf |
| 216 | ./header_test paf |
| 217 | ./misc_test paf |
| 218 | echo "----------------------------------------------------------------------" |
| 219 | echo " $sfversion passed tests on PAF files." |
| 220 | echo "----------------------------------------------------------------------" |
| 221 | |
| 222 | # svx-tests |
| 223 | ./write_read_test svx |
| 224 | ./header_test svx |
| 225 | ./misc_test svx |
| 226 | echo "----------------------------------------------------------------------" |
| 227 | echo " $sfversion passed tests on SVX files." |
| 228 | echo "----------------------------------------------------------------------" |
| 229 | |
| 230 | # nist-tests |
| 231 | ./write_read_test nist |
| 232 | ./lossy_comp_test nist_ulaw |
| 233 | ./lossy_comp_test nist_alaw |
| 234 | ./header_test nist |
| 235 | ./misc_test nist |
| 236 | echo "----------------------------------------------------------------------" |
| 237 | echo " $sfversion passed tests on NIST files." |
| 238 | echo "----------------------------------------------------------------------" |
| 239 | |
| 240 | # ircam-tests |
| 241 | ./write_read_test ircam |
| 242 | ./lossy_comp_test ircam_ulaw |
| 243 | ./lossy_comp_test ircam_alaw |
| 244 | ./header_test ircam |
| 245 | ./misc_test ircam |
| 246 | echo "----------------------------------------------------------------------" |
| 247 | echo " $sfversion passed tests on IRCAM files." |
| 248 | echo "----------------------------------------------------------------------" |
| 249 | |
| 250 | # voc-tests |
| 251 | ./write_read_test voc |
| 252 | ./lossy_comp_test voc_ulaw |
| 253 | ./lossy_comp_test voc_alaw |
| 254 | ./header_test voc |
| 255 | ./misc_test voc |
| 256 | echo "----------------------------------------------------------------------" |
| 257 | echo " $sfversion passed tests on VOC files." |
| 258 | echo "----------------------------------------------------------------------" |
| 259 | |
| 260 | # mat4-tests |
| 261 | ./write_read_test mat4 |
| 262 | ./header_test mat4 |
| 263 | ./misc_test mat4 |
| 264 | echo "----------------------------------------------------------------------" |
| 265 | echo " $sfversion passed tests on MAT4 files." |
| 266 | echo "----------------------------------------------------------------------" |
| 267 | |
| 268 | # mat5-tests |
| 269 | ./write_read_test mat5 |
| 270 | ./header_test mat5 |
| 271 | ./misc_test mat5 |
| 272 | echo "----------------------------------------------------------------------" |
| 273 | echo " $sfversion passed tests on MAT5 files." |
| 274 | echo "----------------------------------------------------------------------" |
| 275 | |
| 276 | # pvf-tests |
| 277 | ./write_read_test pvf |
| 278 | ./header_test pvf |
| 279 | ./misc_test pvf |
| 280 | echo "----------------------------------------------------------------------" |
| 281 | echo " $sfversion passed tests on PVF files." |
| 282 | echo "----------------------------------------------------------------------" |
| 283 | |
| 284 | # xi-tests |
| 285 | ./lossy_comp_test xi_dpcm |
| 286 | echo "----------------------------------------------------------------------" |
| 287 | echo " $sfversion passed tests on XI files." |
| 288 | echo "----------------------------------------------------------------------" |
| 289 | |
| 290 | # htk-tests |
| 291 | ./write_read_test htk |
| 292 | ./header_test htk |
| 293 | ./misc_test htk |
| 294 | echo "----------------------------------------------------------------------" |
| 295 | echo " $sfversion passed tests on HTK files." |
| 296 | echo "----------------------------------------------------------------------" |
| 297 | |
| 298 | # avr-tests |
| 299 | ./write_read_test avr |
| 300 | ./header_test avr |
| 301 | ./misc_test avr |
| 302 | echo "----------------------------------------------------------------------" |
| 303 | echo " $sfversion passed tests on AVR files." |
| 304 | echo "----------------------------------------------------------------------" |
| 305 | |
| 306 | # sds-tests |
| 307 | ./write_read_test sds |
| 308 | ./header_test sds |
| 309 | ./misc_test sds |
| 310 | echo "----------------------------------------------------------------------" |
| 311 | echo " $sfversion passed tests on SDS files." |
| 312 | echo "----------------------------------------------------------------------" |
| 313 | |
| 314 | # sd2-tests |
| 315 | ./write_read_test sd2 |
| 316 | echo "----------------------------------------------------------------------" |
| 317 | echo " $sfversion passed tests on SD2 files." |
| 318 | echo "----------------------------------------------------------------------" |
| 319 | |
| 320 | # wve-tests |
| 321 | ./lossy_comp_test wve |
| 322 | echo "----------------------------------------------------------------------" |
| 323 | echo " $sfversion passed tests on WVE files." |
| 324 | echo "----------------------------------------------------------------------" |
| 325 | |
| 326 | # mpc2k-tests |
| 327 | ./write_read_test mpc2k |
| 328 | ./header_test mpc2k |
| 329 | ./misc_test mpc2k |
| 330 | echo "----------------------------------------------------------------------" |
| 331 | echo " $sfversion passed tests on MPC 2000 files." |
| 332 | echo "----------------------------------------------------------------------" |
| 333 | |
| 334 | # flac-tests |
| 335 | ./write_read_test flac |
| 336 | ./string_test flac |
| 337 | echo "----------------------------------------------------------------------" |
| 338 | echo " $sfversion passed tests on FLAC files." |
| 339 | echo "----------------------------------------------------------------------" |
| 340 | |
| 341 | # vorbis-tests |
| 342 | ./ogg_test |
| 343 | ./vorbis_test |
| 344 | ./lossy_comp_test ogg_vorbis |
| 345 | ./string_test ogg |
| 346 | ./misc_test ogg |
| 347 | echo "----------------------------------------------------------------------" |
| 348 | echo " $sfversion passed tests on OGG/VORBIS files." |
| 349 | echo "----------------------------------------------------------------------" |
| 350 | |
| 351 | # io-tests |
| 352 | ./stdio_test |
| 353 | ./pipe_test |
| 354 | ./virtual_io_test |
| 355 | echo "----------------------------------------------------------------------" |
| 356 | echo " $sfversion passed stdio/pipe/vio tests." |
| 357 | echo "----------------------------------------------------------------------" |
| 358 | |
| 359 | |