4 # Runs our test suite, which (amongst other things)
5 # builds a couple of DCPs.
6 # The outputs are compared against the ones
7 # in test/ref/DCP, and an error is given
8 # if anything is different.
11 if [ ! -e "../libdcp-test" ]; then
12 echo "Test corpus not found"
16 if [ "$1" == "--debug" ]; then
18 LD_LIBRARY_PATH=build/src:build/asdcplib/src gdb --args build/test/tests
19 elif [ "$1" == "--valgrind" ]; then
21 LD_LIBRARY_PATH=build/src:build/asdcplib/src valgrind --tool="memcheck" build/test/tests
23 LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/tests $*
26 diff -ur test/ref/DCP/foo build/test/foo
27 if [ "$?" != "0" ]; then
28 echo "FAIL: files differ"
32 diff -ur test/ref/DCP/bar build/test/bar
33 if [ "$?" != "0" ]; then
34 echo "FAIL: files differ"
38 rm -f build/test/info.log
40 for d in `find ../libdcp-test -mindepth 1 -maxdepth 1 -type d | sort`; do
41 if [ `basename $d` != ".git" ]; then
42 LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo -s $d >> build/test/info.log
43 if [ "$?" != "0" ]; then
44 echo "FAIL: dcpinfo failed for $d"
50 diff -q build/test/info.log ../libdcp-test/info.log
51 if [ "$?" != "0" ]; then
52 echo "FAIL: dcpinfo output incorrect"
56 rm -f build/test/info2.log
57 rm -rf build/test/libdcp-test
59 cp -r ../libdcp-test build/test
60 for d in `find build/test/libdcp-test -mindepth 1 -maxdepth 1 -type d | sort`; do
61 if [ `basename $d` != ".git" ]; then
62 LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/rewrite_subs $d
63 LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo -s $d >> build/test/info2.log
67 sed -i "s/DCP: build\/test/DCP: \.\./g" build/test/info2.log
69 diff -q build/test/info2.log ../libdcp-test/info.log
70 if [ "$?" != "0" ]; then
71 echo "FAIL: dcpinfo output from rewrite incorrect"
75 diff build/test/baz/video1.mxf build/test/baz/video2.mxf
76 if [ "$?" != "0" ]; then
77 echo "FAIL: MXFs from recovery incorrect"