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