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