8b54d2b457757a174818b6cc63e112bd0cd287b5
[dcpomatic.git] / run / tests
1 #!/bin/bash
2 #
3 # e.g. --run_tests=foo
4
5 if [ "$(uname)" == "Linux" ]; then 
6   export LD_LIBRARY_PATH=build/src/lib:/home/c.hetherington/lib:$LD_LIBRARY_PATH
7   rm -f build/test/openssl
8   # This must be our patched openssl or tests will fail
9   ln -s ../../../openssl/apps/openssl build/test/dcpomatic2_openssl
10 fi
11
12 if [ "$1" == "--debug" ]; then
13     shift;
14     gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
15 elif [ "$1" == "--backtrace" ]; then
16     shift;
17     gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
18 elif [ "$1" == "--valgrind" ]; then
19     shift;
20 #    valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
21     valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
22 elif [ "$1" == "--callgrind" ]; then
23     shift;
24     valgrind --tool="callgrind" build/test/unit-tests $*
25 elif [ "$1" == "--quiet" ]; then
26     shift;
27     build/test/unit-tests --catch_system_errors=no $*
28 elif [ "$1" == "--drd" ]; then
29     shift;
30     valgrind --tool="drd" build/test/unit-tests $*
31 elif [ "$1" == "--helgrind" ]; then
32     shift;
33     valgrind --tool="helgrind" build/test/unit-tests $*
34 else
35     ulimit -c unlimited
36     build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
37 #    build/test/unit-tests --catch_system_errors=no $*
38 fi