X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Frun-tests.sh;h=cf98211753733e4b46035b62ccd3f7aa12b89b8c;hb=1f98535b5231e2ff128f08061a59ae5673f04b73;hp=e1330c64f119b1035f3d3c0020518ef8ce4a3e75;hpb=d8657a4ab83ee96c21ce4620e9daca789d76e164;p=ardour.git diff --git a/libs/ardour/run-tests.sh b/libs/ardour/run-tests.sh index e1330c64f1..cf98211753 100755 --- a/libs/ardour/run-tests.sh +++ b/libs/ardour/run-tests.sh @@ -3,22 +3,36 @@ # Run libardour test suite. # -if [ ! -f './tempo.cc' ]; then - echo "This script must be run from within the libs/ardour directory"; - exit 1; -fi - -srcdir=`pwd` -cd ../../build/default - -libs='libs' +TOP=`dirname "$0"`/../.. +. $TOP/build/gtk2_ardour/ardev_common_waf.sh +ARDOUR_LIBS_DIR=$TOP/build/libs/ardour -export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:$LD_LIBRARY_PATH - -export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap - -if [ "$1" == "--debug" ]; then - gdb ./libs/ardour/run-tests +if [ "$1" == "--single" ] || [ "$2" == "--single" ]; then + if [ "$1" == "--single" ]; then + TESTS="test_*$2*" + elif [ "$2" == "--single" ]; then + TESTS="test_*$3*" + else + TESTS='test_*' + fi + for test_program in `find $ARDOUR_LIBS_DIR -name "$TESTS" -type f -perm /u+x`; + do + echo "Running $test_program..." + if [ "$1" == "--debug" ]; then + gdb ./"$test_program" + elif [ "$1" == "--valgrind" ]; then + valgrind ./"$test_program" + else + ./"$test_program" + fi + done else - ./libs/ardour/run-tests + if [ "$1" == "--debug" ]; then + gdb $ARDOUR_LIBS_DIR/run-tests + elif [ "$1" == "--valgrind" ]; then + valgrind $ARDOUR_LIBS_DIR/run-tests + else + $ARDOUR_LIBS_DIR/run-tests $* + fi fi +