summaryrefslogtreecommitdiff
path: root/tests/test_wrapper.sh.in
blob: 15952467711e052bd81bdc10259e5ac839c266c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
#!/bin/sh

# Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in
#       the documentation and/or other materials provided with the
#       distribution.
#     * Neither the author nor the names of any contributors may be used
#       to endorse or promote products derived from this software without
#       specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


HOST_TRIPLET=@HOST_TRIPLET@
PACKAGE_VERSION=@PACKAGE_VERSION@
LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"`

if test -f tests/sfversion@EXEEXT@ ; then
	cd tests
	fi

if test ! -f sfversion@EXEEXT@ ; then
	echo "Not able to find test executables."
	exit 1
	fi

if test -f libsndfile.so.$LIB_VERSION ; then
	# This will work on Linux, but not on Mac.
	# Windows is already sorted out.
	export LD_LIBRARY_PATH=`pwd`
	if test ! -f libsndfile.so.1 ; then
		ln -s libsndfile.so.$LIB_VERSION libsndfile.so.1
		fi
	fi

sfversion=`./sfversion@EXEEXT@ | sed "s/-exp$//"`

if test $sfversion != libsndfile-$PACKAGE_VERSION ; then
	echo "Error : sfversion ($sfversion) and PACKAGE_VERSION ($PACKAGE_VERSION) don't match."
	exit 1
	fi

# Force exit on errors.
set -e

# Generic-tests
uname -a

# Check the header file.
sh pedantic-header-test.sh

# Need this for when we're running from files collected into the
# libsndfile-testsuite-@PACKAGE_VERSION@ tarball.
if test -x test_main@EXEEXT@ ; then
	echo "Running unit tests from src/ directory of source code tree."
	./test_main@EXEEXT@
	echo
	echo "Running end-to-end tests from tests/ directory."
	fi

./error_test@EXEEXT@
./pcm_test@EXEEXT@
./ulaw_test@EXEEXT@
./alaw_test@EXEEXT@
./dwvw_test@EXEEXT@
./command_test@EXEEXT@ ver
./command_test@EXEEXT@ norm
./command_test@EXEEXT@ format
./command_test@EXEEXT@ peak
./command_test@EXEEXT@ trunc
./command_test@EXEEXT@ inst
./command_test@EXEEXT@ current_sf_info
./command_test@EXEEXT@ bext
./command_test@EXEEXT@ bextch
./command_test@EXEEXT@ chanmap
./floating_point_test@EXEEXT@
./checksum_test@EXEEXT@
./scale_clip_test@EXEEXT@
./headerless_test@EXEEXT@
./rdwr_test@EXEEXT@
./locale_test@EXEEXT@
./win32_ordinal_test@EXEEXT@
./external_libs_test@EXEEXT@
./format_check_test@EXEEXT@

# The w64 G++ compiler requires an extra runtime DLL which we don't have,
# so skip this test.
case "$HOST_TRIPLET" in
	x86_64-w64-mingw32)
		;;
	i686-w64-mingw32)
		;;
	*)
		./cpp_test@EXEEXT@
		;;
	esac

echo "----------------------------------------------------------------------"
echo "  $sfversion passed common tests."
echo "----------------------------------------------------------------------"

# aiff-tests
./write_read_test@EXEEXT@ aiff
./lossy_comp_test@EXEEXT@ aiff_ulaw
./lossy_comp_test@EXEEXT@ aiff_alaw
./lossy_comp_test@EXEEXT@ aiff_gsm610
echo "=========================="
echo "./lossy_comp_test@EXEEXT@ aiff_ima"
echo "=========================="
./peak_chunk_test@EXEEXT@ aiff
./header_test@EXEEXT@ aiff
./misc_test@EXEEXT@ aiff
./string_test@EXEEXT@ aiff
./multi_file_test@EXEEXT@ aiff
./aiff_rw_test@EXEEXT@
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on AIFF files."
echo "----------------------------------------------------------------------"

# au-tests
./write_read_test@EXEEXT@ au
./lossy_comp_test@EXEEXT@ au_ulaw
./lossy_comp_test@EXEEXT@ au_alaw
./lossy_comp_test@EXEEXT@ au_g721
./lossy_comp_test@EXEEXT@ au_g723
./header_test@EXEEXT@ au
./misc_test@EXEEXT@ au
./multi_file_test@EXEEXT@ au
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on AU files."
echo "----------------------------------------------------------------------"

# caf-tests
./write_read_test@EXEEXT@ caf
./lossy_comp_test@EXEEXT@ caf_ulaw
./lossy_comp_test@EXEEXT@ caf_alaw
./header_test@EXEEXT@ caf
./peak_chunk_test@EXEEXT@ caf
./misc_test@EXEEXT@ caf
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on CAF files."
echo "----------------------------------------------------------------------"

# wav-tests
./write_read_test@EXEEXT@ wav
./lossy_comp_test@EXEEXT@ wav_pcm
./lossy_comp_test@EXEEXT@ wav_ima
./lossy_comp_test@EXEEXT@ wav_msadpcm
./lossy_comp_test@EXEEXT@ wav_ulaw
./lossy_comp_test@EXEEXT@ wav_alaw
./lossy_comp_test@EXEEXT@ wav_gsm610
./lossy_comp_test@EXEEXT@ wav_g721
./peak_chunk_test@EXEEXT@ wav
./header_test@EXEEXT@ wav
./misc_test@EXEEXT@ wav
./string_test@EXEEXT@ wav
./multi_file_test@EXEEXT@ wav
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on WAV files."
echo "----------------------------------------------------------------------"

# w64-tests
./write_read_test@EXEEXT@ w64
./lossy_comp_test@EXEEXT@ w64_ima
./lossy_comp_test@EXEEXT@ w64_msadpcm
./lossy_comp_test@EXEEXT@ w64_ulaw
./lossy_comp_test@EXEEXT@ w64_alaw
./lossy_comp_test@EXEEXT@ w64_gsm610
./header_test@EXEEXT@ w64
./misc_test@EXEEXT@ w64
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on W64 files."
echo "----------------------------------------------------------------------"

# rf64-tests
./write_read_test@EXEEXT@ rf64
./header_test@EXEEXT@ rf64
./misc_test@EXEEXT@ rf64
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on RF64 files."
echo "----------------------------------------------------------------------"

# raw-tests
./write_read_test@EXEEXT@ raw
./lossy_comp_test@EXEEXT@ raw_ulaw
./lossy_comp_test@EXEEXT@ raw_alaw
./lossy_comp_test@EXEEXT@ raw_gsm610
./lossy_comp_test@EXEEXT@ vox_adpcm
./raw_test@EXEEXT@
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on RAW (header-less) files."
echo "----------------------------------------------------------------------"

# paf-tests
./write_read_test@EXEEXT@ paf
./header_test@EXEEXT@ paf
./misc_test@EXEEXT@ paf
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on PAF files."
echo "----------------------------------------------------------------------"

# svx-tests
./write_read_test@EXEEXT@ svx
./header_test@EXEEXT@ svx
./misc_test@EXEEXT@ svx
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on SVX files."
echo "----------------------------------------------------------------------"

# nist-tests
./write_read_test@EXEEXT@ nist
./lossy_comp_test@EXEEXT@ nist_ulaw
./lossy_comp_test@EXEEXT@ nist_alaw
./header_test@EXEEXT@ nist
./misc_test@EXEEXT@ nist
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on NIST files."
echo "----------------------------------------------------------------------"

# ircam-tests
./write_read_test@EXEEXT@ ircam
./lossy_comp_test@EXEEXT@ ircam_ulaw
./lossy_comp_test@EXEEXT@ ircam_alaw
./header_test@EXEEXT@ ircam
./misc_test@EXEEXT@ ircam
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on IRCAM files."
echo "----------------------------------------------------------------------"

# voc-tests
./write_read_test@EXEEXT@ voc
./lossy_comp_test@EXEEXT@ voc_ulaw
./lossy_comp_test@EXEEXT@ voc_alaw
./header_test@EXEEXT@ voc
./misc_test@EXEEXT@ voc
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on VOC files."
echo "----------------------------------------------------------------------"

# mat4-tests
./write_read_test@EXEEXT@ mat4
./header_test@EXEEXT@ mat4
./misc_test@EXEEXT@ mat4
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on MAT4 files."
echo "----------------------------------------------------------------------"

# mat5-tests
./write_read_test@EXEEXT@ mat5
./header_test@EXEEXT@ mat5
./misc_test@EXEEXT@ mat5
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on MAT5 files."
echo "----------------------------------------------------------------------"

# pvf-tests
./write_read_test@EXEEXT@ pvf
./header_test@EXEEXT@ pvf
./misc_test@EXEEXT@ pvf
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on PVF files."
echo "----------------------------------------------------------------------"

# xi-tests
./lossy_comp_test@EXEEXT@ xi_dpcm
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on XI files."
echo "----------------------------------------------------------------------"

# htk-tests
./write_read_test@EXEEXT@ htk
./header_test@EXEEXT@ htk
./misc_test@EXEEXT@ htk
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on HTK files."
echo "----------------------------------------------------------------------"

# avr-tests
./write_read_test@EXEEXT@ avr
./header_test@EXEEXT@ avr
./misc_test@EXEEXT@ avr
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on AVR files."
echo "----------------------------------------------------------------------"

# sds-tests
./write_read_test@EXEEXT@ sds
./header_test@EXEEXT@ sds
./misc_test@EXEEXT@ sds
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on SDS files."
echo "----------------------------------------------------------------------"

# sd2-tests
./write_read_test@EXEEXT@ sd2
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on SD2 files."
echo "----------------------------------------------------------------------"

# wve-tests
./lossy_comp_test@EXEEXT@ wve
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on WVE files."
echo "----------------------------------------------------------------------"

# mpc2k-tests
./write_read_test@EXEEXT@ mpc2k
./header_test@EXEEXT@ mpc2k
./misc_test@EXEEXT@ mpc2k
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on MPC 2000 files."
echo "----------------------------------------------------------------------"

# flac-tests
./write_read_test@EXEEXT@ flac
./string_test@EXEEXT@ flac
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on FLAC files."
echo "----------------------------------------------------------------------"

# vorbis-tests
./ogg_test@EXEEXT@
./vorbis_test@EXEEXT@
./lossy_comp_test@EXEEXT@ ogg_vorbis
./string_test@EXEEXT@ ogg
./misc_test@EXEEXT@ ogg
echo "----------------------------------------------------------------------"
echo "  $sfversion passed tests on OGG/VORBIS files."
echo "----------------------------------------------------------------------"

# io-tests
./stdio_test@EXEEXT@
./pipe_test@EXEEXT@
./virtual_io_test@EXEEXT@
echo "----------------------------------------------------------------------"
echo "  $sfversion passed stdio/pipe/vio tests."
echo "----------------------------------------------------------------------"