test_wrapper.sh.in 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. #!/bin/sh
  2. # Copyright (C) 2008-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
  3. #
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are
  8. # met:
  9. #
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. # * Redistributions in binary form must reproduce the above copyright
  13. # notice, this list of conditions and the following disclaimer in
  14. # the documentation and/or other materials provided with the
  15. # distribution.
  16. # * Neither the author nor the names of any contributors may be used
  17. # to endorse or promote products derived from this software without
  18. # specific prior written permission.
  19. #
  20. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  22. # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23. # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  30. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. HOST_TRIPLET=@HOST_TRIPLET@
  32. PACKAGE_VERSION=@PACKAGE_VERSION@
  33. LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"`
  34. if test -f tests/sfversion@EXEEXT@ ; then
  35. cd tests
  36. fi
  37. if test ! -f sfversion@EXEEXT@ ; then
  38. echo "Not able to find test executables."
  39. exit 1
  40. fi
  41. if test -f libsndfile.so.$LIB_VERSION ; then
  42. # This will work on Linux, but not on Mac.
  43. # Windows is already sorted out.
  44. export LD_LIBRARY_PATH=`pwd`
  45. if test ! -f libsndfile.so.1 ; then
  46. ln -s libsndfile.so.$LIB_VERSION libsndfile.so.1
  47. fi
  48. fi
  49. sfversion=`./sfversion@EXEEXT@ | sed "s/-exp$//"`
  50. if test $sfversion != libsndfile-$PACKAGE_VERSION ; then
  51. echo "Error : sfversion ($sfversion) and PACKAGE_VERSION ($PACKAGE_VERSION) don't match."
  52. exit 1
  53. fi
  54. # Force exit on errors.
  55. set -e
  56. # Generic-tests
  57. uname -a
  58. # Check the header file.
  59. sh pedantic-header-test.sh
  60. # Need this for when we're running from files collected into the
  61. # libsndfile-testsuite-@PACKAGE_VERSION@ tarball.
  62. if test -x test_main@EXEEXT@ ; then
  63. echo "Running unit tests from src/ directory of source code tree."
  64. ./test_main@EXEEXT@
  65. echo
  66. echo "Running end-to-end tests from tests/ directory."
  67. fi
  68. ./error_test@EXEEXT@
  69. ./pcm_test@EXEEXT@
  70. ./ulaw_test@EXEEXT@
  71. ./alaw_test@EXEEXT@
  72. ./dwvw_test@EXEEXT@
  73. ./command_test@EXEEXT@ ver
  74. ./command_test@EXEEXT@ norm
  75. ./command_test@EXEEXT@ format
  76. ./command_test@EXEEXT@ peak
  77. ./command_test@EXEEXT@ trunc
  78. ./command_test@EXEEXT@ inst
  79. ./command_test@EXEEXT@ current_sf_info
  80. ./command_test@EXEEXT@ bext
  81. ./command_test@EXEEXT@ bextch
  82. ./command_test@EXEEXT@ chanmap
  83. ./command_test@EXEEXT@ cart
  84. ./floating_point_test@EXEEXT@
  85. ./checksum_test@EXEEXT@
  86. ./scale_clip_test@EXEEXT@
  87. ./headerless_test@EXEEXT@
  88. ./rdwr_test@EXEEXT@
  89. ./locale_test@EXEEXT@
  90. ./win32_ordinal_test@EXEEXT@
  91. ./external_libs_test@EXEEXT@
  92. ./format_check_test@EXEEXT@
  93. ./channel_test@EXEEXT@
  94. # The w64 G++ compiler requires an extra runtime DLL which we don't have,
  95. # so skip this test.
  96. case "$HOST_TRIPLET" in
  97. x86_64-w64-mingw32)
  98. ;;
  99. i686-w64-mingw32)
  100. ;;
  101. *)
  102. ./cpp_test@EXEEXT@
  103. ;;
  104. esac
  105. echo "----------------------------------------------------------------------"
  106. echo " $sfversion passed common tests."
  107. echo "----------------------------------------------------------------------"
  108. # aiff-tests
  109. ./write_read_test@EXEEXT@ aiff
  110. ./lossy_comp_test@EXEEXT@ aiff_ulaw
  111. ./lossy_comp_test@EXEEXT@ aiff_alaw
  112. ./lossy_comp_test@EXEEXT@ aiff_gsm610
  113. echo "=========================="
  114. echo "./lossy_comp_test@EXEEXT@ aiff_ima"
  115. echo "=========================="
  116. ./peak_chunk_test@EXEEXT@ aiff
  117. ./header_test@EXEEXT@ aiff
  118. ./misc_test@EXEEXT@ aiff
  119. ./string_test@EXEEXT@ aiff
  120. ./multi_file_test@EXEEXT@ aiff
  121. ./aiff_rw_test@EXEEXT@
  122. ./chunk_test@EXEEXT@ aiff
  123. echo "----------------------------------------------------------------------"
  124. echo " $sfversion passed tests on AIFF files."
  125. echo "----------------------------------------------------------------------"
  126. # au-tests
  127. ./write_read_test@EXEEXT@ au
  128. ./lossy_comp_test@EXEEXT@ au_ulaw
  129. ./lossy_comp_test@EXEEXT@ au_alaw
  130. ./lossy_comp_test@EXEEXT@ au_g721
  131. ./lossy_comp_test@EXEEXT@ au_g723
  132. ./header_test@EXEEXT@ au
  133. ./misc_test@EXEEXT@ au
  134. ./multi_file_test@EXEEXT@ au
  135. echo "----------------------------------------------------------------------"
  136. echo " $sfversion passed tests on AU files."
  137. echo "----------------------------------------------------------------------"
  138. # caf-tests
  139. ./write_read_test@EXEEXT@ caf
  140. ./lossy_comp_test@EXEEXT@ caf_ulaw
  141. ./lossy_comp_test@EXEEXT@ caf_alaw
  142. ./header_test@EXEEXT@ caf
  143. ./peak_chunk_test@EXEEXT@ caf
  144. ./misc_test@EXEEXT@ caf
  145. ./chunk_test@EXEEXT@ caf
  146. echo "----------------------------------------------------------------------"
  147. echo " $sfversion passed tests on CAF files."
  148. echo "----------------------------------------------------------------------"
  149. # wav-tests
  150. ./write_read_test@EXEEXT@ wav
  151. ./lossy_comp_test@EXEEXT@ wav_pcm
  152. ./lossy_comp_test@EXEEXT@ wav_ima
  153. ./lossy_comp_test@EXEEXT@ wav_msadpcm
  154. ./lossy_comp_test@EXEEXT@ wav_ulaw
  155. ./lossy_comp_test@EXEEXT@ wav_alaw
  156. ./lossy_comp_test@EXEEXT@ wav_gsm610
  157. ./lossy_comp_test@EXEEXT@ wav_g721
  158. ./peak_chunk_test@EXEEXT@ wav
  159. ./header_test@EXEEXT@ wav
  160. ./misc_test@EXEEXT@ wav
  161. ./string_test@EXEEXT@ wav
  162. ./multi_file_test@EXEEXT@ wav
  163. ./chunk_test@EXEEXT@ wav
  164. echo "----------------------------------------------------------------------"
  165. echo " $sfversion passed tests on WAV files."
  166. echo "----------------------------------------------------------------------"
  167. # w64-tests
  168. ./write_read_test@EXEEXT@ w64
  169. ./lossy_comp_test@EXEEXT@ w64_ima
  170. ./lossy_comp_test@EXEEXT@ w64_msadpcm
  171. ./lossy_comp_test@EXEEXT@ w64_ulaw
  172. ./lossy_comp_test@EXEEXT@ w64_alaw
  173. ./lossy_comp_test@EXEEXT@ w64_gsm610
  174. ./header_test@EXEEXT@ w64
  175. ./misc_test@EXEEXT@ w64
  176. echo "----------------------------------------------------------------------"
  177. echo " $sfversion passed tests on W64 files."
  178. echo "----------------------------------------------------------------------"
  179. # rf64-tests
  180. ./write_read_test@EXEEXT@ rf64
  181. ./header_test@EXEEXT@ rf64
  182. ./misc_test@EXEEXT@ rf64
  183. echo "----------------------------------------------------------------------"
  184. echo " $sfversion passed tests on RF64 files."
  185. echo "----------------------------------------------------------------------"
  186. # raw-tests
  187. ./write_read_test@EXEEXT@ raw
  188. ./lossy_comp_test@EXEEXT@ raw_ulaw
  189. ./lossy_comp_test@EXEEXT@ raw_alaw
  190. ./lossy_comp_test@EXEEXT@ raw_gsm610
  191. ./lossy_comp_test@EXEEXT@ vox_adpcm
  192. ./raw_test@EXEEXT@
  193. echo "----------------------------------------------------------------------"
  194. echo " $sfversion passed tests on RAW (header-less) files."
  195. echo "----------------------------------------------------------------------"
  196. # paf-tests
  197. ./write_read_test@EXEEXT@ paf
  198. ./header_test@EXEEXT@ paf
  199. ./misc_test@EXEEXT@ paf
  200. echo "----------------------------------------------------------------------"
  201. echo " $sfversion passed tests on PAF files."
  202. echo "----------------------------------------------------------------------"
  203. # svx-tests
  204. ./write_read_test@EXEEXT@ svx
  205. ./header_test@EXEEXT@ svx
  206. ./misc_test@EXEEXT@ svx
  207. echo "----------------------------------------------------------------------"
  208. echo " $sfversion passed tests on SVX files."
  209. echo "----------------------------------------------------------------------"
  210. # nist-tests
  211. ./write_read_test@EXEEXT@ nist
  212. ./lossy_comp_test@EXEEXT@ nist_ulaw
  213. ./lossy_comp_test@EXEEXT@ nist_alaw
  214. ./header_test@EXEEXT@ nist
  215. ./misc_test@EXEEXT@ nist
  216. echo "----------------------------------------------------------------------"
  217. echo " $sfversion passed tests on NIST files."
  218. echo "----------------------------------------------------------------------"
  219. # ircam-tests
  220. ./write_read_test@EXEEXT@ ircam
  221. ./lossy_comp_test@EXEEXT@ ircam_ulaw
  222. ./lossy_comp_test@EXEEXT@ ircam_alaw
  223. ./header_test@EXEEXT@ ircam
  224. ./misc_test@EXEEXT@ ircam
  225. echo "----------------------------------------------------------------------"
  226. echo " $sfversion passed tests on IRCAM files."
  227. echo "----------------------------------------------------------------------"
  228. # voc-tests
  229. ./write_read_test@EXEEXT@ voc
  230. ./lossy_comp_test@EXEEXT@ voc_ulaw
  231. ./lossy_comp_test@EXEEXT@ voc_alaw
  232. ./header_test@EXEEXT@ voc
  233. ./misc_test@EXEEXT@ voc
  234. echo "----------------------------------------------------------------------"
  235. echo " $sfversion passed tests on VOC files."
  236. echo "----------------------------------------------------------------------"
  237. # mat4-tests
  238. ./write_read_test@EXEEXT@ mat4
  239. ./header_test@EXEEXT@ mat4
  240. ./misc_test@EXEEXT@ mat4
  241. echo "----------------------------------------------------------------------"
  242. echo " $sfversion passed tests on MAT4 files."
  243. echo "----------------------------------------------------------------------"
  244. # mat5-tests
  245. ./write_read_test@EXEEXT@ mat5
  246. ./header_test@EXEEXT@ mat5
  247. ./misc_test@EXEEXT@ mat5
  248. echo "----------------------------------------------------------------------"
  249. echo " $sfversion passed tests on MAT5 files."
  250. echo "----------------------------------------------------------------------"
  251. # pvf-tests
  252. ./write_read_test@EXEEXT@ pvf
  253. ./header_test@EXEEXT@ pvf
  254. ./misc_test@EXEEXT@ pvf
  255. echo "----------------------------------------------------------------------"
  256. echo " $sfversion passed tests on PVF files."
  257. echo "----------------------------------------------------------------------"
  258. # xi-tests
  259. ./lossy_comp_test@EXEEXT@ xi_dpcm
  260. echo "----------------------------------------------------------------------"
  261. echo " $sfversion passed tests on XI files."
  262. echo "----------------------------------------------------------------------"
  263. # htk-tests
  264. ./write_read_test@EXEEXT@ htk
  265. ./header_test@EXEEXT@ htk
  266. ./misc_test@EXEEXT@ htk
  267. echo "----------------------------------------------------------------------"
  268. echo " $sfversion passed tests on HTK files."
  269. echo "----------------------------------------------------------------------"
  270. # avr-tests
  271. ./write_read_test@EXEEXT@ avr
  272. ./header_test@EXEEXT@ avr
  273. ./misc_test@EXEEXT@ avr
  274. echo "----------------------------------------------------------------------"
  275. echo " $sfversion passed tests on AVR files."
  276. echo "----------------------------------------------------------------------"
  277. # sds-tests
  278. ./write_read_test@EXEEXT@ sds
  279. ./header_test@EXEEXT@ sds
  280. ./misc_test@EXEEXT@ sds
  281. echo "----------------------------------------------------------------------"
  282. echo " $sfversion passed tests on SDS files."
  283. echo "----------------------------------------------------------------------"
  284. # sd2-tests
  285. ./write_read_test@EXEEXT@ sd2
  286. echo "----------------------------------------------------------------------"
  287. echo " $sfversion passed tests on SD2 files."
  288. echo "----------------------------------------------------------------------"
  289. # wve-tests
  290. ./lossy_comp_test@EXEEXT@ wve
  291. echo "----------------------------------------------------------------------"
  292. echo " $sfversion passed tests on WVE files."
  293. echo "----------------------------------------------------------------------"
  294. # mpc2k-tests
  295. ./write_read_test@EXEEXT@ mpc2k
  296. ./header_test@EXEEXT@ mpc2k
  297. ./misc_test@EXEEXT@ mpc2k
  298. echo "----------------------------------------------------------------------"
  299. echo " $sfversion passed tests on MPC 2000 files."
  300. echo "----------------------------------------------------------------------"
  301. # flac-tests
  302. ./write_read_test@EXEEXT@ flac
  303. ./compression_size_test@EXEEXT@ flac
  304. ./string_test@EXEEXT@ flac
  305. echo "----------------------------------------------------------------------"
  306. echo " $sfversion passed tests on FLAC files."
  307. echo "----------------------------------------------------------------------"
  308. # vorbis-tests
  309. ./ogg_test@EXEEXT@
  310. ./compression_size_test@EXEEXT@ vorbis
  311. ./lossy_comp_test@EXEEXT@ ogg_vorbis
  312. ./string_test@EXEEXT@ ogg
  313. ./misc_test@EXEEXT@ ogg
  314. echo "----------------------------------------------------------------------"
  315. echo " $sfversion passed tests on OGG/VORBIS files."
  316. echo "----------------------------------------------------------------------"
  317. # io-tests
  318. ./stdio_test@EXEEXT@
  319. ./pipe_test@EXEEXT@
  320. ./virtual_io_test@EXEEXT@
  321. echo "----------------------------------------------------------------------"
  322. echo " $sfversion passed stdio/pipe/vio tests."
  323. echo "----------------------------------------------------------------------"