comparison tests/run-tests.sh @ 252:fe4dc39b2dd7

Perform the incredibly tedious job of making the tests bash scripts, rather than shell scripts. This seems easier than emulating all the useful error-handling features that bash provides in POSIX functionality as provided by dash(1).
author mas01cr
date Mon, 31 Mar 2008 13:02:26 +0000
parents 2cc06e5b05a5
children 216b55457009
comparison
equal deleted inserted replaced
251:a6c9a1c68646 252:fe4dc39b2dd7
1 #! /bin/sh 1 #! /bin/bash
2 2
3 AUDIODB=../../${EXECUTABLE:-audioDB} 3 AUDIODB=../../${EXECUTABLE:-audioDB}
4 export AUDIODB 4 export AUDIODB
5 5
6 if [ -x ${AUDIODB:3} ]; then 6 if [ -x ${AUDIODB#../} ]; then
7 : 7 :
8 else 8 else
9 echo Cannot execute audioDB: ${AUDIODB:3} 9 echo Cannot execute audioDB: ${AUDIODB#../}
10 exit 1 10 exit 1
11 fi 11 fi
12 12
13 if [ "$1" = "--full" ]; then 13 if [ "$1" = "--full" ]; then
14 pattern="[0-9][0-9][0-9][0-9]*" 14 pattern="[0-9][0-9][0-9][0-9]*"
22 echo -n Running test ${file} 22 echo -n Running test ${file}
23 if [ -f ${file}/short-description ]; then 23 if [ -f ${file}/short-description ]; then
24 awk '{ printf(" (%s)",$0) }' < ${file}/short-description 24 awk '{ printf(" (%s)",$0) }' < ${file}/short-description
25 fi 25 fi
26 echo -n : 26 echo -n :
27 (cd ${file} && sh ./run-test.sh > test.out 2> test.err) 27 (cd ${file} && /bin/bash ./run-test.sh > test.out 2> test.err)
28 EXIT_STATUS=$? 28 EXIT_STATUS=$?
29 if [ ${EXIT_STATUS} -eq 14 ]; then 29 if [ ${EXIT_STATUS} -eq 14 ]; then
30 echo " n/a." 30 echo " n/a."
31 elif [ ${EXIT_STATUS} -ne 104 ]; then 31 elif [ ${EXIT_STATUS} -ne 104 ]; then
32 echo " failed (exit status ${EXIT_STATUS})." 32 echo " failed (exit status ${EXIT_STATUS})."