blob: b8765b9d88ed266486552c97c03278d153f2dfd9 [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=x86_64-unknown-linux-gnu
35PACKAGE_VERSION=1.0.25
36LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"`
37
38if test -f tests/sfversion ; then
39 cd tests
40 fi
41
42if test ! -f sfversion ; 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 | 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-1.0.25 tarball.
74if 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.
108case "$HOST_TRIPLET" in
109 x86_64-w64-mingw32)
110 ;;
111 i686-w64-mingw32)
112 ;;
113 *)
114 ./cpp_test
115 ;;
116 esac
117
118echo "----------------------------------------------------------------------"
119echo " $sfversion passed common tests."
120echo "----------------------------------------------------------------------"
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
127echo "=========================="
128echo "./lossy_comp_test aiff_ima"
129echo "=========================="
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
136echo "----------------------------------------------------------------------"
137echo " $sfversion passed tests on AIFF files."
138echo "----------------------------------------------------------------------"
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
149echo "----------------------------------------------------------------------"
150echo " $sfversion passed tests on AU files."
151echo "----------------------------------------------------------------------"
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
160echo "----------------------------------------------------------------------"
161echo " $sfversion passed tests on CAF files."
162echo "----------------------------------------------------------------------"
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
178echo "----------------------------------------------------------------------"
179echo " $sfversion passed tests on WAV files."
180echo "----------------------------------------------------------------------"
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
191echo "----------------------------------------------------------------------"
192echo " $sfversion passed tests on W64 files."
193echo "----------------------------------------------------------------------"
194
195# rf64-tests
196./write_read_test rf64
197./header_test rf64
198./misc_test rf64
199echo "----------------------------------------------------------------------"
200echo " $sfversion passed tests on RF64 files."
201echo "----------------------------------------------------------------------"
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
210echo "----------------------------------------------------------------------"
211echo " $sfversion passed tests on RAW (header-less) files."
212echo "----------------------------------------------------------------------"
213
214# paf-tests
215./write_read_test paf
216./header_test paf
217./misc_test paf
218echo "----------------------------------------------------------------------"
219echo " $sfversion passed tests on PAF files."
220echo "----------------------------------------------------------------------"
221
222# svx-tests
223./write_read_test svx
224./header_test svx
225./misc_test svx
226echo "----------------------------------------------------------------------"
227echo " $sfversion passed tests on SVX files."
228echo "----------------------------------------------------------------------"
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
236echo "----------------------------------------------------------------------"
237echo " $sfversion passed tests on NIST files."
238echo "----------------------------------------------------------------------"
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
246echo "----------------------------------------------------------------------"
247echo " $sfversion passed tests on IRCAM files."
248echo "----------------------------------------------------------------------"
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
256echo "----------------------------------------------------------------------"
257echo " $sfversion passed tests on VOC files."
258echo "----------------------------------------------------------------------"
259
260# mat4-tests
261./write_read_test mat4
262./header_test mat4
263./misc_test mat4
264echo "----------------------------------------------------------------------"
265echo " $sfversion passed tests on MAT4 files."
266echo "----------------------------------------------------------------------"
267
268# mat5-tests
269./write_read_test mat5
270./header_test mat5
271./misc_test mat5
272echo "----------------------------------------------------------------------"
273echo " $sfversion passed tests on MAT5 files."
274echo "----------------------------------------------------------------------"
275
276# pvf-tests
277./write_read_test pvf
278./header_test pvf
279./misc_test pvf
280echo "----------------------------------------------------------------------"
281echo " $sfversion passed tests on PVF files."
282echo "----------------------------------------------------------------------"
283
284# xi-tests
285./lossy_comp_test xi_dpcm
286echo "----------------------------------------------------------------------"
287echo " $sfversion passed tests on XI files."
288echo "----------------------------------------------------------------------"
289
290# htk-tests
291./write_read_test htk
292./header_test htk
293./misc_test htk
294echo "----------------------------------------------------------------------"
295echo " $sfversion passed tests on HTK files."
296echo "----------------------------------------------------------------------"
297
298# avr-tests
299./write_read_test avr
300./header_test avr
301./misc_test avr
302echo "----------------------------------------------------------------------"
303echo " $sfversion passed tests on AVR files."
304echo "----------------------------------------------------------------------"
305
306# sds-tests
307./write_read_test sds
308./header_test sds
309./misc_test sds
310echo "----------------------------------------------------------------------"
311echo " $sfversion passed tests on SDS files."
312echo "----------------------------------------------------------------------"
313
314# sd2-tests
315./write_read_test sd2
316echo "----------------------------------------------------------------------"
317echo " $sfversion passed tests on SD2 files."
318echo "----------------------------------------------------------------------"
319
320# wve-tests
321./lossy_comp_test wve
322echo "----------------------------------------------------------------------"
323echo " $sfversion passed tests on WVE files."
324echo "----------------------------------------------------------------------"
325
326# mpc2k-tests
327./write_read_test mpc2k
328./header_test mpc2k
329./misc_test mpc2k
330echo "----------------------------------------------------------------------"
331echo " $sfversion passed tests on MPC 2000 files."
332echo "----------------------------------------------------------------------"
333
334# flac-tests
335./write_read_test flac
336./string_test flac
337echo "----------------------------------------------------------------------"
338echo " $sfversion passed tests on FLAC files."
339echo "----------------------------------------------------------------------"
340
341# vorbis-tests
342./ogg_test
343./vorbis_test
344./lossy_comp_test ogg_vorbis
345./string_test ogg
346./misc_test ogg
347echo "----------------------------------------------------------------------"
348echo " $sfversion passed tests on OGG/VORBIS files."
349echo "----------------------------------------------------------------------"
350
351# io-tests
352./stdio_test
353./pipe_test
354./virtual_io_test
355echo "----------------------------------------------------------------------"
356echo " $sfversion passed stdio/pipe/vio tests."
357echo "----------------------------------------------------------------------"
358
359