blob: 15952467711e052bd81bdc10259e5ac839c266c2 [file] [log] [blame]
Alexandre Lision7c6f4a62013-09-05 13:27:01 -04001#!/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
34HOST_TRIPLET=@HOST_TRIPLET@
35PACKAGE_VERSION=@PACKAGE_VERSION@
36LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"`
37
38if test -f tests/sfversion@EXEEXT@ ; then
39 cd tests
40 fi
41
42if test ! -f sfversion@EXEEXT@ ; then
43 echo "Not able to find test executables."
44 exit 1
45 fi
46
47if 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
56sfversion=`./sfversion@EXEEXT@ | sed "s/-exp$//"`
57
58if 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.
64set -e
65
66# Generic-tests
67uname -a
68
69# Check the header file.
70sh pedantic-header-test.sh
71
72# Need this for when we're running from files collected into the
73# libsndfile-testsuite-@PACKAGE_VERSION@ tarball.
74if 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@ current_sf_info
93./command_test@EXEEXT@ bext
94./command_test@EXEEXT@ bextch
95./command_test@EXEEXT@ chanmap
96./floating_point_test@EXEEXT@
97./checksum_test@EXEEXT@
98./scale_clip_test@EXEEXT@
99./headerless_test@EXEEXT@
100./rdwr_test@EXEEXT@
101./locale_test@EXEEXT@
102./win32_ordinal_test@EXEEXT@
103./external_libs_test@EXEEXT@
104./format_check_test@EXEEXT@
105
106# The w64 G++ compiler requires an extra runtime DLL which we don't have,
107# so skip this test.
108case "$HOST_TRIPLET" in
109 x86_64-w64-mingw32)
110 ;;
111 i686-w64-mingw32)
112 ;;
113 *)
114 ./cpp_test@EXEEXT@
115 ;;
116 esac
117
118echo "----------------------------------------------------------------------"
119echo " $sfversion passed common tests."
120echo "----------------------------------------------------------------------"
121
122# aiff-tests
123./write_read_test@EXEEXT@ aiff
124./lossy_comp_test@EXEEXT@ aiff_ulaw
125./lossy_comp_test@EXEEXT@ aiff_alaw
126./lossy_comp_test@EXEEXT@ aiff_gsm610
127echo "=========================="
128echo "./lossy_comp_test@EXEEXT@ aiff_ima"
129echo "=========================="
130./peak_chunk_test@EXEEXT@ aiff
131./header_test@EXEEXT@ aiff
132./misc_test@EXEEXT@ aiff
133./string_test@EXEEXT@ aiff
134./multi_file_test@EXEEXT@ aiff
135./aiff_rw_test@EXEEXT@
136echo "----------------------------------------------------------------------"
137echo " $sfversion passed tests on AIFF files."
138echo "----------------------------------------------------------------------"
139
140# au-tests
141./write_read_test@EXEEXT@ au
142./lossy_comp_test@EXEEXT@ au_ulaw
143./lossy_comp_test@EXEEXT@ au_alaw
144./lossy_comp_test@EXEEXT@ au_g721
145./lossy_comp_test@EXEEXT@ au_g723
146./header_test@EXEEXT@ au
147./misc_test@EXEEXT@ au
148./multi_file_test@EXEEXT@ au
149echo "----------------------------------------------------------------------"
150echo " $sfversion passed tests on AU files."
151echo "----------------------------------------------------------------------"
152
153# caf-tests
154./write_read_test@EXEEXT@ caf
155./lossy_comp_test@EXEEXT@ caf_ulaw
156./lossy_comp_test@EXEEXT@ caf_alaw
157./header_test@EXEEXT@ caf
158./peak_chunk_test@EXEEXT@ caf
159./misc_test@EXEEXT@ caf
160echo "----------------------------------------------------------------------"
161echo " $sfversion passed tests on CAF files."
162echo "----------------------------------------------------------------------"
163
164# wav-tests
165./write_read_test@EXEEXT@ wav
166./lossy_comp_test@EXEEXT@ wav_pcm
167./lossy_comp_test@EXEEXT@ wav_ima
168./lossy_comp_test@EXEEXT@ wav_msadpcm
169./lossy_comp_test@EXEEXT@ wav_ulaw
170./lossy_comp_test@EXEEXT@ wav_alaw
171./lossy_comp_test@EXEEXT@ wav_gsm610
172./lossy_comp_test@EXEEXT@ wav_g721
173./peak_chunk_test@EXEEXT@ wav
174./header_test@EXEEXT@ wav
175./misc_test@EXEEXT@ wav
176./string_test@EXEEXT@ wav
177./multi_file_test@EXEEXT@ wav
178echo "----------------------------------------------------------------------"
179echo " $sfversion passed tests on WAV files."
180echo "----------------------------------------------------------------------"
181
182# w64-tests
183./write_read_test@EXEEXT@ w64
184./lossy_comp_test@EXEEXT@ w64_ima
185./lossy_comp_test@EXEEXT@ w64_msadpcm
186./lossy_comp_test@EXEEXT@ w64_ulaw
187./lossy_comp_test@EXEEXT@ w64_alaw
188./lossy_comp_test@EXEEXT@ w64_gsm610
189./header_test@EXEEXT@ w64
190./misc_test@EXEEXT@ w64
191echo "----------------------------------------------------------------------"
192echo " $sfversion passed tests on W64 files."
193echo "----------------------------------------------------------------------"
194
195# rf64-tests
196./write_read_test@EXEEXT@ rf64
197./header_test@EXEEXT@ rf64
198./misc_test@EXEEXT@ rf64
199echo "----------------------------------------------------------------------"
200echo " $sfversion passed tests on RF64 files."
201echo "----------------------------------------------------------------------"
202
203# raw-tests
204./write_read_test@EXEEXT@ raw
205./lossy_comp_test@EXEEXT@ raw_ulaw
206./lossy_comp_test@EXEEXT@ raw_alaw
207./lossy_comp_test@EXEEXT@ raw_gsm610
208./lossy_comp_test@EXEEXT@ vox_adpcm
209./raw_test@EXEEXT@
210echo "----------------------------------------------------------------------"
211echo " $sfversion passed tests on RAW (header-less) files."
212echo "----------------------------------------------------------------------"
213
214# paf-tests
215./write_read_test@EXEEXT@ paf
216./header_test@EXEEXT@ paf
217./misc_test@EXEEXT@ paf
218echo "----------------------------------------------------------------------"
219echo " $sfversion passed tests on PAF files."
220echo "----------------------------------------------------------------------"
221
222# svx-tests
223./write_read_test@EXEEXT@ svx
224./header_test@EXEEXT@ svx
225./misc_test@EXEEXT@ svx
226echo "----------------------------------------------------------------------"
227echo " $sfversion passed tests on SVX files."
228echo "----------------------------------------------------------------------"
229
230# nist-tests
231./write_read_test@EXEEXT@ nist
232./lossy_comp_test@EXEEXT@ nist_ulaw
233./lossy_comp_test@EXEEXT@ nist_alaw
234./header_test@EXEEXT@ nist
235./misc_test@EXEEXT@ nist
236echo "----------------------------------------------------------------------"
237echo " $sfversion passed tests on NIST files."
238echo "----------------------------------------------------------------------"
239
240# ircam-tests
241./write_read_test@EXEEXT@ ircam
242./lossy_comp_test@EXEEXT@ ircam_ulaw
243./lossy_comp_test@EXEEXT@ ircam_alaw
244./header_test@EXEEXT@ ircam
245./misc_test@EXEEXT@ ircam
246echo "----------------------------------------------------------------------"
247echo " $sfversion passed tests on IRCAM files."
248echo "----------------------------------------------------------------------"
249
250# voc-tests
251./write_read_test@EXEEXT@ voc
252./lossy_comp_test@EXEEXT@ voc_ulaw
253./lossy_comp_test@EXEEXT@ voc_alaw
254./header_test@EXEEXT@ voc
255./misc_test@EXEEXT@ voc
256echo "----------------------------------------------------------------------"
257echo " $sfversion passed tests on VOC files."
258echo "----------------------------------------------------------------------"
259
260# mat4-tests
261./write_read_test@EXEEXT@ mat4
262./header_test@EXEEXT@ mat4
263./misc_test@EXEEXT@ mat4
264echo "----------------------------------------------------------------------"
265echo " $sfversion passed tests on MAT4 files."
266echo "----------------------------------------------------------------------"
267
268# mat5-tests
269./write_read_test@EXEEXT@ mat5
270./header_test@EXEEXT@ mat5
271./misc_test@EXEEXT@ mat5
272echo "----------------------------------------------------------------------"
273echo " $sfversion passed tests on MAT5 files."
274echo "----------------------------------------------------------------------"
275
276# pvf-tests
277./write_read_test@EXEEXT@ pvf
278./header_test@EXEEXT@ pvf
279./misc_test@EXEEXT@ pvf
280echo "----------------------------------------------------------------------"
281echo " $sfversion passed tests on PVF files."
282echo "----------------------------------------------------------------------"
283
284# xi-tests
285./lossy_comp_test@EXEEXT@ xi_dpcm
286echo "----------------------------------------------------------------------"
287echo " $sfversion passed tests on XI files."
288echo "----------------------------------------------------------------------"
289
290# htk-tests
291./write_read_test@EXEEXT@ htk
292./header_test@EXEEXT@ htk
293./misc_test@EXEEXT@ htk
294echo "----------------------------------------------------------------------"
295echo " $sfversion passed tests on HTK files."
296echo "----------------------------------------------------------------------"
297
298# avr-tests
299./write_read_test@EXEEXT@ avr
300./header_test@EXEEXT@ avr
301./misc_test@EXEEXT@ avr
302echo "----------------------------------------------------------------------"
303echo " $sfversion passed tests on AVR files."
304echo "----------------------------------------------------------------------"
305
306# sds-tests
307./write_read_test@EXEEXT@ sds
308./header_test@EXEEXT@ sds
309./misc_test@EXEEXT@ sds
310echo "----------------------------------------------------------------------"
311echo " $sfversion passed tests on SDS files."
312echo "----------------------------------------------------------------------"
313
314# sd2-tests
315./write_read_test@EXEEXT@ sd2
316echo "----------------------------------------------------------------------"
317echo " $sfversion passed tests on SD2 files."
318echo "----------------------------------------------------------------------"
319
320# wve-tests
321./lossy_comp_test@EXEEXT@ wve
322echo "----------------------------------------------------------------------"
323echo " $sfversion passed tests on WVE files."
324echo "----------------------------------------------------------------------"
325
326# mpc2k-tests
327./write_read_test@EXEEXT@ mpc2k
328./header_test@EXEEXT@ mpc2k
329./misc_test@EXEEXT@ mpc2k
330echo "----------------------------------------------------------------------"
331echo " $sfversion passed tests on MPC 2000 files."
332echo "----------------------------------------------------------------------"
333
334# flac-tests
335./write_read_test@EXEEXT@ flac
336./string_test@EXEEXT@ flac
337echo "----------------------------------------------------------------------"
338echo " $sfversion passed tests on FLAC files."
339echo "----------------------------------------------------------------------"
340
341# vorbis-tests
342./ogg_test@EXEEXT@
343./vorbis_test@EXEEXT@
344./lossy_comp_test@EXEEXT@ ogg_vorbis
345./string_test@EXEEXT@ ogg
346./misc_test@EXEEXT@ ogg
347echo "----------------------------------------------------------------------"
348echo " $sfversion passed tests on OGG/VORBIS files."
349echo "----------------------------------------------------------------------"
350
351# io-tests
352./stdio_test@EXEEXT@
353./pipe_test@EXEEXT@
354./virtual_io_test@EXEEXT@
355echo "----------------------------------------------------------------------"
356echo " $sfversion passed stdio/pipe/vio tests."
357echo "----------------------------------------------------------------------"
358
359