Mercurial > hg > audiodb
annotate tests/run-tests.sh @ 277:abfb26e08d9c audiodb-debian
Merge trunk changes -r326:386 into audiodb-debian branch.
Plus new debian/changelog version. (Should have used an epoch really,
but couldn't be bothered; TODO: work out a sane version numbering
policy).
author | mas01cr |
---|---|
date | Tue, 01 Jul 2008 09:12:40 +0000 |
parents | 15b8ff55ea5b |
children |
rev | line source |
---|---|
mas01cr@277 | 1 #! /bin/bash |
mas01cr@78 | 2 |
mas01cr@78 | 3 AUDIODB=../../${EXECUTABLE:-audioDB} |
mas01cr@78 | 4 export AUDIODB |
mas01cr@78 | 5 |
mas01cr@277 | 6 if [ -x ${AUDIODB#../} ]; then |
mas01cr@78 | 7 : |
mas01cr@78 | 8 else |
mas01cr@277 | 9 echo Cannot execute audioDB: ${AUDIODB#../} |
mas01cr@78 | 10 exit 1 |
mas01cr@78 | 11 fi |
mas01cr@78 | 12 |
mas01cr@167 | 13 if [ "$1" = "--full" ]; then |
mas01cr@167 | 14 pattern="[0-9][0-9][0-9][0-9]*" |
mas01cr@167 | 15 else |
mas01cr@167 | 16 pattern="[0-8][0-9][0-9][0-9]*" |
mas01cr@167 | 17 fi |
mas01cr@167 | 18 |
mas01cr@167 | 19 for file in ${pattern}; do |
mas01cr@78 | 20 if [ -d ${file} ]; then |
mas01cr@78 | 21 if [ -f ${file}/run-test.sh ]; then |
mas01cr@78 | 22 echo -n Running test ${file} |
mas01cr@78 | 23 if [ -f ${file}/short-description ]; then |
mas01cr@78 | 24 awk '{ printf(" (%s)",$0) }' < ${file}/short-description |
mas01cr@78 | 25 fi |
mas01cr@78 | 26 echo -n : |
mas01cr@277 | 27 (cd ${file} && /bin/bash ./run-test.sh > test.out 2> test.err) |
mas01cr@78 | 28 EXIT_STATUS=$? |
mas01cr@243 | 29 if [ ${EXIT_STATUS} -eq 14 ]; then |
mas01cr@243 | 30 echo " n/a." |
mas01cr@243 | 31 elif [ ${EXIT_STATUS} -ne 104 ]; then |
mas01cr@243 | 32 echo " failed (exit status ${EXIT_STATUS})." |
mas01cr@78 | 33 FAILED=true |
mas01cr@78 | 34 else |
mas01cr@78 | 35 echo " success." |
mas01cr@78 | 36 fi |
mas01cr@78 | 37 else |
mas01cr@78 | 38 echo Skipping test ${file} |
mas01cr@78 | 39 fi |
mas01cr@78 | 40 fi |
mas01cr@78 | 41 done |
mas01cr@78 | 42 |
mas01cr@78 | 43 if [ -z "${FAILED}" ]; then |
mas01cr@78 | 44 exit 0 |
mas01cr@78 | 45 else |
mas01cr@78 | 46 exit 1 |
mas01cr@78 | 47 fi |