Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / run-session-tests.sh
1 #!/bin/bash
2 #
3 # Run simple session load tester over a corpus of sessions.
4 #
5
6 if [ ! -f './tempo.cc' ]; then
7     echo "This script must be run from within the libs/ardour directory";
8     exit 1;
9 fi
10
11 . test-env.sh
12
13 f=""
14 if [ "$1" == "--debug" -o "$1" == "--valgrind" ]; then
15   f=$1
16   shift 1
17 fi
18
19 d=$1
20 if [ "$d" == "" ]; then
21   echo "Syntax: run-session-tests.sh <corpus>"
22   exit 1
23 fi
24
25 for s in `find $d -mindepth 1 -maxdepth 1 -type d`; do
26   n=`basename $s`
27   if [ "$f" == "--debug" ]; then
28     gdb --args ./libs/ardour/load-session $s $n
29   elif [ "$f" == "--valgrind" ]; then
30     valgrind ./libs/ardour/load-session $s $n
31   else
32     ./libs/ardour/load-session $s $n
33   fi
34 done
35