Supporters update.
[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:$LD_LIBRARY_PATH
7   rm -f build/test/dcpomatic2_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 [ "$(uname)" == "Darwin" ]; then
15   resources=build/Resources
16   rm -rf $resources
17   mkdir -p $resources
18   cp fonts/*.ttf $resources
19   cp -r ../libdcp/tags $resources
20   cp -r ../libdcp/xsd $resources
21   rm -f build/test/openssl
22   ln -s ../../../openssl/apps/openssl build/test/openssl
23   # SIP stops this being passed in from the caller's environment
24   export DYLD_LIBRARY_PATH=/Users/ci/osx-environment/x86_64/10.10/lib
25   # We need to find ffcmp in here
26   export PATH=$PATH:/Users/ci/workspace/bin
27 fi
28
29 if [ "$1" == "--debug" ]; then
30     shift;
31     gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
32 elif [ "$1" == "--backtrace" ]; then
33     shift;
34     gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
35 elif [ "$1" == "--valgrind" ]; then
36     shift;
37 #    valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
38     valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
39 elif [ "$1" == "--callgrind" ]; then
40     shift;
41     valgrind --tool="callgrind" build/test/unit-tests $*
42 elif [ "$1" == "--quiet" ]; then
43     shift;
44     build/test/unit-tests --catch_system_errors=no $*
45 elif [ "$1" == "--drd" ]; then
46     shift;
47     valgrind --tool="drd" build/test/unit-tests $*
48 elif [ "$1" == "--helgrind" ]; then
49     shift;
50     valgrind --tool="helgrind" build/test/unit-tests $*
51 else
52     ulimit -c unlimited
53     build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
54 #    build/test/unit-tests --catch_system_errors=no $*
55 fi