6 PRIVATE_GIT="881c48805e352dfe150993814757ca974282be18"
8 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
9 source $DIR/environment
13 while [[ $# -gt 0 ]]; do
58 if [ "$(uname)" == "Linux" ]; then
59 rm -f build/test/dcpomatic2_openssl
61 # This must be our patched openssl or tests will fail
62 if [ ! -f build/test/dcpomatic2_openssl ]; then
63 ln -s ../../../openssl/apps/openssl build/test/dcpomatic2_openssl
65 export DCPOMATIC_TEST_TOOLS_PATH=/opt/asdcplib/bin
66 if [ -f /src/backports/dcp_inspect ]; then
67 export DCPOMATIC_DCP_INSPECT=/src/backports/dcp_inspect
70 python3 -m clairmeta.cli --help > /dev/null 2>&1
71 if [ "$?" == "0" ]; then
72 export DCPOMATIC_CLAIRMETA=1
77 if [ "$(uname)" == "Darwin" ]; then
78 resources=build/Resources
81 cp fonts/*.ttf $resources
82 cp -r ../libdcp/tags $resources
83 cp -r ../libdcp/xsd $resources
84 cp ../libdcp/ratings $resources
85 rm -f build/test/openssl
86 ln -s ../../../openssl/apps/openssl build/test/openssl
87 # We need to find ffcmp in here
88 export PATH=$PATH:/Users/ci/workspace/bin
89 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$environment/x86_64/10.10/lib
92 if [ "$check" == "1" ]; then
93 if [ "$DCPOMATIC_TEST_PRIVATE" == "" ]; then
94 pushd ../dcpomatic-test-private
96 pushd $DCPOMATIC_TEST_PRIVATE
98 current=$(git rev-parse HEAD)
99 if [ "$current" != "$PRIVATE_GIT" ]; then
100 echo "Unexpected dcpomatic-test-private version"
106 if [ "$type" == "debug" ]; then
107 gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
108 elif [ "$type" == "backtrace" ]; then
109 gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
110 elif [ "$type" == "valgrind" ]; then
111 # valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
112 valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
113 elif [ "$type" == "callgrind" ]; then
114 valgrind --tool="callgrind" build/test/unit-tests $*
115 elif [ "$type" == "quiet" ]; then
116 build/test/unit-tests --catch_system_errors=no $*
117 elif [ "$type" == "drd" ]; then
118 valgrind --tool="drd" build/test/unit-tests $*
119 elif [ "$type" == "helgrind" ]; then
120 valgrind --tool="helgrind" build/test/unit-tests $*
123 build/test/unit-tests --catch_system_errors=no $*