Mercurial > hg > audiodb
annotate tests/run-tests.sh @ 164:218106b4db14
Add a test for dump/restore functionality.
Since it takes a long time (and must be run after the other tests), put
it in 9000/ and adjust run-tests.sh to take a --full argument.
author | mas01cr |
---|---|
date | Mon, 05 Nov 2007 10:54:53 +0000 |
parents | 1fc7f47b422b |
children | 3c7c8b84e4f3 |
rev | line source |
---|---|
mas01cr@38 | 1 #! /bin/sh |
mas01cr@38 | 2 |
mas01cr@39 | 3 AUDIODB=../../${EXECUTABLE:-audioDB} |
mas01cr@39 | 4 export AUDIODB |
mas01cr@39 | 5 |
mas01cr@39 | 6 if [ -x ${AUDIODB:3} ]; then |
mas01cr@39 | 7 : |
mas01cr@39 | 8 else |
mas01cr@39 | 9 echo Cannot execute audioDB: ${AUDIODB:3} |
mas01cr@39 | 10 exit 1 |
mas01cr@39 | 11 fi |
mas01cr@39 | 12 |
mas01cr@164 | 13 if [ "$1" = "--full" ]; then |
mas01cr@164 | 14 pattern="[0-9][0-9][0-9][0-9]*" |
mas01cr@164 | 15 else |
mas01cr@164 | 16 pattern="[0-8][0-9][0-9][0-9]*" |
mas01cr@164 | 17 fi |
mas01cr@164 | 18 |
mas01cr@164 | 19 for file in ${pattern}; do |
mas01cr@38 | 20 if [ -d ${file} ]; then |
mas01cr@38 | 21 if [ -f ${file}/run-test.sh ]; then |
mas01cr@67 | 22 echo -n Running test ${file} |
mas01cr@67 | 23 if [ -f ${file}/short-description ]; then |
mas01cr@67 | 24 awk '{ printf(" (%s)",$0) }' < ${file}/short-description |
mas01cr@67 | 25 fi |
mas01cr@67 | 26 echo -n : |
mas01cr@41 | 27 (cd ${file} && sh ./run-test.sh > test.out 2> test.err) |
mas01cr@38 | 28 EXIT_STATUS=$? |
mas01cr@38 | 29 if [ ${EXIT_STATUS} -ne 104 ]; then |
mas01cr@67 | 30 echo " failed (exit status ${EXIT_STATUS})". |
mas01cr@67 | 31 FAILED=true |
mas01cr@67 | 32 else |
mas01cr@67 | 33 echo " success." |
mas01cr@38 | 34 fi |
mas01cr@38 | 35 else |
mas01cr@38 | 36 echo Skipping test ${file} |
mas01cr@38 | 37 fi |
mas01cr@38 | 38 fi |
mas01cr@38 | 39 done |
mas01cr@67 | 40 |
mas01cr@73 | 41 if [ -z "${FAILED}" ]; then |
mas01cr@67 | 42 exit 0 |
mas01cr@67 | 43 else |
mas01cr@67 | 44 exit 1 |
mas01cr@67 | 45 fi |