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
14 if [ "$(uname)" == "Darwin" ]; then
15 resources=build/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/64/lib
27 if [ "$1" == "--debug" ]; then
29 gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
30 elif [ "$1" == "--backtrace" ]; then
32 gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
33 elif [ "$1" == "--valgrind" ]; then
35 # valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
36 valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
37 elif [ "$1" == "--callgrind" ]; then
39 valgrind --tool="callgrind" build/test/unit-tests $*
40 elif [ "$1" == "--quiet" ]; then
42 build/test/unit-tests --catch_system_errors=no $*
43 elif [ "$1" == "--drd" ]; then
45 valgrind --tool="drd" build/test/unit-tests $*
46 elif [ "$1" == "--helgrind" ]; then
48 valgrind --tool="helgrind" build/test/unit-tests $*
51 build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
52 # build/test/unit-tests --catch_system_errors=no $*