Fix error when trying to make the openssl symlink again.
[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   if [ ! -f build/test/dcpomatic2_openssl ]; then 
10     ln -s ../../../openssl/apps/openssl build/test/dcpomatic2_openssl
11   fi
12 fi
13
14 if [ "$1" == "--debug" ]; then
15     shift;
16     gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
17 elif [ "$1" == "--backtrace" ]; then
18     shift;
19     gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
20 elif [ "$1" == "--valgrind" ]; then
21     shift;
22 #    valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
23     valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
24 elif [ "$1" == "--callgrind" ]; then
25     shift;
26     valgrind --tool="callgrind" build/test/unit-tests $*
27 elif [ "$1" == "--quiet" ]; then
28     shift;
29     build/test/unit-tests --catch_system_errors=no $*
30 elif [ "$1" == "--drd" ]; then
31     shift;
32     valgrind --tool="drd" build/test/unit-tests $*
33 elif [ "$1" == "--helgrind" ]; then
34     shift;
35     valgrind --tool="helgrind" build/test/unit-tests $*
36 else
37     ulimit -c unlimited
38     build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
39 #    build/test/unit-tests --catch_system_errors=no $*
40 fi