comparison src/libsndfile-1.0.27/tests/test_wrapper.sh.in @ 125:cd6cdf86811e

Current libsndfile source
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 18 Oct 2016 13:22:47 +0100
parents
children
comparison
equal deleted inserted replaced
124:e3d5853d5918 125:cd6cdf86811e
1 #!/bin/sh
2
3 # Copyright (C) 2008-2016 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=@HOST_TRIPLET@
35 PACKAGE_VERSION=@PACKAGE_VERSION@
36 LIB_VERSION=$(echo $PACKAGE_VERSION | sed "s/[a-z].*//")
37
38 if test -f tests/sfversion@EXEEXT@ ; then
39 cd tests
40 fi
41
42 if test ! -f sfversion@EXEEXT@ ; 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@EXEEXT@ | grep libsndfile | 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-@PACKAGE_VERSION@ tarball.
74 if test -x test_main@EXEEXT@ ; then
75 echo "Running unit tests from src/ directory of source code tree."
76 ./test_main@EXEEXT@
77 echo
78 echo "Running end-to-end tests from tests/ directory."
79 fi
80
81 ./error_test@EXEEXT@
82 ./pcm_test@EXEEXT@
83 ./ulaw_test@EXEEXT@
84 ./alaw_test@EXEEXT@
85 ./dwvw_test@EXEEXT@
86 ./command_test@EXEEXT@ ver
87 ./command_test@EXEEXT@ norm
88 ./command_test@EXEEXT@ format
89 ./command_test@EXEEXT@ peak
90 ./command_test@EXEEXT@ trunc
91 ./command_test@EXEEXT@ inst
92 ./command_test@EXEEXT@ cue
93 ./command_test@EXEEXT@ current_sf_info
94 ./command_test@EXEEXT@ bext
95 ./command_test@EXEEXT@ bextch
96 ./command_test@EXEEXT@ chanmap
97 ./command_test@EXEEXT@ cart
98 ./floating_point_test@EXEEXT@
99 ./checksum_test@EXEEXT@
100 ./scale_clip_test@EXEEXT@
101 ./headerless_test@EXEEXT@
102 ./rdwr_test@EXEEXT@
103 ./locale_test@EXEEXT@
104 ./win32_ordinal_test@EXEEXT@
105 ./external_libs_test@EXEEXT@
106 ./format_check_test@EXEEXT@
107 ./channel_test@EXEEXT@
108
109 # The w64 G++ compiler requires an extra runtime DLL which we don't have,
110 # so skip this test.
111 case "$HOST_TRIPLET" in
112 x86_64-w64-mingw32)
113 ;;
114 i686-w64-mingw32)
115 ;;
116 *)
117 ./cpp_test@EXEEXT@
118 ;;
119 esac
120
121 echo "----------------------------------------------------------------------"
122 echo " $sfversion passed common tests."
123 echo "----------------------------------------------------------------------"
124
125 # aiff-tests
126 ./write_read_test@EXEEXT@ aiff
127 ./lossy_comp_test@EXEEXT@ aiff_ulaw
128 ./lossy_comp_test@EXEEXT@ aiff_alaw
129 ./lossy_comp_test@EXEEXT@ aiff_gsm610
130 echo "=========================="
131 echo "./lossy_comp_test@EXEEXT@ aiff_ima"
132 echo "=========================="
133 ./peak_chunk_test@EXEEXT@ aiff
134 ./header_test@EXEEXT@ aiff
135 ./misc_test@EXEEXT@ aiff
136 ./string_test@EXEEXT@ aiff
137 ./multi_file_test@EXEEXT@ aiff
138 ./aiff_rw_test@EXEEXT@
139 ./chunk_test@EXEEXT@ aiff
140 echo "----------------------------------------------------------------------"
141 echo " $sfversion passed tests on AIFF files."
142 echo "----------------------------------------------------------------------"
143
144 # au-tests
145 ./write_read_test@EXEEXT@ au
146 ./lossy_comp_test@EXEEXT@ au_ulaw
147 ./lossy_comp_test@EXEEXT@ au_alaw
148 ./lossy_comp_test@EXEEXT@ au_g721
149 ./lossy_comp_test@EXEEXT@ au_g723
150 ./header_test@EXEEXT@ au
151 ./misc_test@EXEEXT@ au
152 ./multi_file_test@EXEEXT@ au
153 echo "----------------------------------------------------------------------"
154 echo " $sfversion passed tests on AU files."
155 echo "----------------------------------------------------------------------"
156
157 # caf-tests
158 ./write_read_test@EXEEXT@ caf
159 ./lossy_comp_test@EXEEXT@ caf_ulaw
160 ./lossy_comp_test@EXEEXT@ caf_alaw
161 ./header_test@EXEEXT@ caf
162 ./peak_chunk_test@EXEEXT@ caf
163 ./misc_test@EXEEXT@ caf
164 ./chunk_test@EXEEXT@ caf
165 ./string_test@EXEEXT@ caf
166 ./long_read_write_test@EXEEXT@ alac
167 echo "----------------------------------------------------------------------"
168 echo " $sfversion passed tests on CAF files."
169 echo "----------------------------------------------------------------------"
170
171 # wav-tests
172 ./write_read_test@EXEEXT@ wav
173 ./lossy_comp_test@EXEEXT@ wav_pcm
174 ./lossy_comp_test@EXEEXT@ wav_ima
175 ./lossy_comp_test@EXEEXT@ wav_msadpcm
176 ./lossy_comp_test@EXEEXT@ wav_ulaw
177 ./lossy_comp_test@EXEEXT@ wav_alaw
178 ./lossy_comp_test@EXEEXT@ wav_gsm610
179 ./lossy_comp_test@EXEEXT@ wav_g721
180 ./peak_chunk_test@EXEEXT@ wav
181 ./header_test@EXEEXT@ wav
182 ./misc_test@EXEEXT@ wav
183 ./string_test@EXEEXT@ wav
184 ./multi_file_test@EXEEXT@ wav
185 ./chunk_test@EXEEXT@ wav
186 echo "----------------------------------------------------------------------"
187 echo " $sfversion passed tests on WAV files."
188 echo "----------------------------------------------------------------------"
189
190 # w64-tests
191 ./write_read_test@EXEEXT@ w64
192 ./lossy_comp_test@EXEEXT@ w64_ima
193 ./lossy_comp_test@EXEEXT@ w64_msadpcm
194 ./lossy_comp_test@EXEEXT@ w64_ulaw
195 ./lossy_comp_test@EXEEXT@ w64_alaw
196 ./lossy_comp_test@EXEEXT@ w64_gsm610
197 ./header_test@EXEEXT@ w64
198 ./misc_test@EXEEXT@ w64
199 echo "----------------------------------------------------------------------"
200 echo " $sfversion passed tests on W64 files."
201 echo "----------------------------------------------------------------------"
202
203 # rf64-tests
204 ./write_read_test@EXEEXT@ rf64
205 ./header_test@EXEEXT@ rf64
206 ./misc_test@EXEEXT@ rf64
207 ./string_test@EXEEXT@ rf64
208 ./peak_chunk_test@EXEEXT@ rf64
209 ./chunk_test@EXEEXT@ rf64
210 echo "----------------------------------------------------------------------"
211 echo " $sfversion passed tests on RF64 files."
212 echo "----------------------------------------------------------------------"
213
214 # raw-tests
215 ./write_read_test@EXEEXT@ raw
216 ./lossy_comp_test@EXEEXT@ raw_ulaw
217 ./lossy_comp_test@EXEEXT@ raw_alaw
218 ./lossy_comp_test@EXEEXT@ raw_gsm610
219 ./lossy_comp_test@EXEEXT@ vox_adpcm
220 ./raw_test@EXEEXT@
221 echo "----------------------------------------------------------------------"
222 echo " $sfversion passed tests on RAW (header-less) files."
223 echo "----------------------------------------------------------------------"
224
225 # paf-tests
226 ./write_read_test@EXEEXT@ paf
227 ./header_test@EXEEXT@ paf
228 ./misc_test@EXEEXT@ paf
229 echo "----------------------------------------------------------------------"
230 echo " $sfversion passed tests on PAF files."
231 echo "----------------------------------------------------------------------"
232
233 # svx-tests
234 ./write_read_test@EXEEXT@ svx
235 ./header_test@EXEEXT@ svx
236 ./misc_test@EXEEXT@ svx
237 echo "----------------------------------------------------------------------"
238 echo " $sfversion passed tests on SVX files."
239 echo "----------------------------------------------------------------------"
240
241 # nist-tests
242 ./write_read_test@EXEEXT@ nist
243 ./lossy_comp_test@EXEEXT@ nist_ulaw
244 ./lossy_comp_test@EXEEXT@ nist_alaw
245 ./header_test@EXEEXT@ nist
246 ./misc_test@EXEEXT@ nist
247 echo "----------------------------------------------------------------------"
248 echo " $sfversion passed tests on NIST files."
249 echo "----------------------------------------------------------------------"
250
251 # ircam-tests
252 ./write_read_test@EXEEXT@ ircam
253 ./lossy_comp_test@EXEEXT@ ircam_ulaw
254 ./lossy_comp_test@EXEEXT@ ircam_alaw
255 ./header_test@EXEEXT@ ircam
256 ./misc_test@EXEEXT@ ircam
257 echo "----------------------------------------------------------------------"
258 echo " $sfversion passed tests on IRCAM files."
259 echo "----------------------------------------------------------------------"
260
261 # voc-tests
262 ./write_read_test@EXEEXT@ voc
263 ./lossy_comp_test@EXEEXT@ voc_ulaw
264 ./lossy_comp_test@EXEEXT@ voc_alaw
265 ./header_test@EXEEXT@ voc
266 ./misc_test@EXEEXT@ voc
267 echo "----------------------------------------------------------------------"
268 echo " $sfversion passed tests on VOC files."
269 echo "----------------------------------------------------------------------"
270
271 # mat4-tests
272 ./write_read_test@EXEEXT@ mat4
273 ./header_test@EXEEXT@ mat4
274 ./misc_test@EXEEXT@ mat4
275 echo "----------------------------------------------------------------------"
276 echo " $sfversion passed tests on MAT4 files."
277 echo "----------------------------------------------------------------------"
278
279 # mat5-tests
280 ./write_read_test@EXEEXT@ mat5
281 ./header_test@EXEEXT@ mat5
282 ./misc_test@EXEEXT@ mat5
283 echo "----------------------------------------------------------------------"
284 echo " $sfversion passed tests on MAT5 files."
285 echo "----------------------------------------------------------------------"
286
287 # pvf-tests
288 ./write_read_test@EXEEXT@ pvf
289 ./header_test@EXEEXT@ pvf
290 ./misc_test@EXEEXT@ pvf
291 echo "----------------------------------------------------------------------"
292 echo " $sfversion passed tests on PVF files."
293 echo "----------------------------------------------------------------------"
294
295 # xi-tests
296 ./lossy_comp_test@EXEEXT@ xi_dpcm
297 echo "----------------------------------------------------------------------"
298 echo " $sfversion passed tests on XI files."
299 echo "----------------------------------------------------------------------"
300
301 # htk-tests
302 ./write_read_test@EXEEXT@ htk
303 ./header_test@EXEEXT@ htk
304 ./misc_test@EXEEXT@ htk
305 echo "----------------------------------------------------------------------"
306 echo " $sfversion passed tests on HTK files."
307 echo "----------------------------------------------------------------------"
308
309 # avr-tests
310 ./write_read_test@EXEEXT@ avr
311 ./header_test@EXEEXT@ avr
312 ./misc_test@EXEEXT@ avr
313 echo "----------------------------------------------------------------------"
314 echo " $sfversion passed tests on AVR files."
315 echo "----------------------------------------------------------------------"
316
317 # sds-tests
318 ./write_read_test@EXEEXT@ sds
319 ./header_test@EXEEXT@ sds
320 ./misc_test@EXEEXT@ sds
321 echo "----------------------------------------------------------------------"
322 echo " $sfversion passed tests on SDS files."
323 echo "----------------------------------------------------------------------"
324
325 # sd2-tests
326 ./write_read_test@EXEEXT@ sd2
327 echo "----------------------------------------------------------------------"
328 echo " $sfversion passed tests on SD2 files."
329 echo "----------------------------------------------------------------------"
330
331 # wve-tests
332 ./lossy_comp_test@EXEEXT@ wve
333 echo "----------------------------------------------------------------------"
334 echo " $sfversion passed tests on WVE files."
335 echo "----------------------------------------------------------------------"
336
337 # mpc2k-tests
338 ./write_read_test@EXEEXT@ mpc2k
339 ./header_test@EXEEXT@ mpc2k
340 ./misc_test@EXEEXT@ mpc2k
341 echo "----------------------------------------------------------------------"
342 echo " $sfversion passed tests on MPC 2000 files."
343 echo "----------------------------------------------------------------------"
344
345 # flac-tests
346 ./write_read_test@EXEEXT@ flac
347 ./compression_size_test@EXEEXT@ flac
348 ./string_test@EXEEXT@ flac
349 echo "----------------------------------------------------------------------"
350 echo " $sfversion passed tests on FLAC files."
351 echo "----------------------------------------------------------------------"
352
353 # vorbis-tests
354 ./ogg_test@EXEEXT@
355 ./compression_size_test@EXEEXT@ vorbis
356 ./lossy_comp_test@EXEEXT@ ogg_vorbis
357 ./string_test@EXEEXT@ ogg
358 ./misc_test@EXEEXT@ ogg
359 echo "----------------------------------------------------------------------"
360 echo " $sfversion passed tests on OGG/VORBIS files."
361 echo "----------------------------------------------------------------------"
362
363 # io-tests
364 ./stdio_test@EXEEXT@
365 ./pipe_test@EXEEXT@
366 ./virtual_io_test@EXEEXT@
367 echo "----------------------------------------------------------------------"
368 echo " $sfversion passed stdio/pipe/vio tests."
369 echo "----------------------------------------------------------------------"
370
371