Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / run-tests.sh
1 #!/bin/bash
2 #
3 # Run libardour test suite.
4 #
5 . test-env.sh
6
7 if [ "$1" == "--single" ] || [ "$2" == "--single" ]; then
8         if [ "$1" == "--single" ]; then
9                 TESTS="test_*$2*"
10         elif [ "$2" == "--single" ]; then
11                 TESTS="test_*$3*"
12         else
13                 TESTS='test_*'
14         fi
15         for test_program in `find libs/ardour -name "$TESTS" -type f -perm /u+x`;
16         do
17                 echo "Running $test_program..."
18                 if [ "$1" == "--debug" ]; then
19                         gdb ./"$test_program"
20                 elif [ "$1" == "--valgrind" ]; then
21                         valgrind ./"$test_program"
22                 else
23                         ./"$test_program"
24                 fi
25         done
26 else
27         if [ "$1" == "--debug" ]; then
28                 gdb ./libs/ardour/run-tests
29         elif [ "$1" == "--valgrind" ]; then
30                 valgrind ./libs/ardour/run-tests
31         else
32                 ./libs/ardour/run-tests $*
33         fi
34 fi
35