fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / run-tests.sh
1 #!/bin/bash
2 #
3 # Run libardour test suite.
4 #
5
6 TOP=`dirname "$0"`/../..
7 . $TOP/build/gtk2_ardour/ardev_common_waf.sh
8 ARDOUR_LIBS_DIR=$TOP/build/libs/ardour
9
10 if [ "$1" == "--single" ] || [ "$2" == "--single" ]; then
11         if [ "$1" == "--single" ]; then
12                 TESTS="test_*$2*"
13         elif [ "$2" == "--single" ]; then
14                 TESTS="test_*$3*"
15         else
16                 TESTS='test_*'
17         fi
18         for test_program in `find $ARDOUR_LIBS_DIR -name "$TESTS" -type f -perm /u+x`;
19         do
20                 echo "Running $test_program..."
21                 if [ "$1" == "--debug" ]; then
22                         gdb ./"$test_program"
23                 elif [ "$1" == "--valgrind" ]; then
24                         valgrind ./"$test_program"
25                 else
26                         ./"$test_program"
27                 fi
28         done
29 else
30         if [ "$1" == "--debug" ]; then
31                 gdb $ARDOUR_LIBS_DIR/run-tests
32         elif [ "$1" == "--valgrind" ]; then
33                 valgrind $ARDOUR_LIBS_DIR/run-tests
34         else
35                 $ARDOUR_LIBS_DIR/run-tests $*
36         fi
37 fi
38