5 # Private test data; this is stuff that is non-distributable
6 private=../libdcp-test-private
10 dcpinfo=build/tools/dcpinfo
11 dcpverify=build/tools/dcpverify
13 export LD_LIBRARY_PATH=build/src:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
14 # SIP stops this being passed in from the caller's environment
15 export DYLD_LIBRARY_PATH=/Users/ci/osx-environment/x86_64/10.10/lib:/Users/ci/workspace/lib
16 export LIBDCP_RESOURCES=.
18 # Make sure we have the required tools
19 for c in xmlsec1 xmllint; do
20 hash $c 2>/dev/null || { echo >&2 "$c required but not found; aborting"; exit 1; }
25 # Run the unit tests in test/
26 if [ "$1" == "--debug" ]; then
28 gdb --args $work/tests $private $*
29 elif [ "$1" == "--valgrind" ]; then
31 valgrind --tool="memcheck" $work/tests $private $*
32 elif [ "$1" == "--callgrind" ]; then
34 valgrind --tool="callgrind" $work/tests $private $*
36 $work/tests $* -- $private
37 if [ "$?" != "0" ]; then
38 echo "FAIL: unit tests"
43 if [ "$*" != "" ]; then
44 echo "Skipping post-test checks as not all unit tests were run."
48 echo "--- Other tests"
50 # Check the DCP written by dcp_test1
51 diff -ur test/ref/DCP/dcp_test1 $work/DCP/dcp_test1
52 if [ "$?" != "0" ]; then
53 echo "FAIL: files differ"
57 # Check the DCP written by dcp_test2
58 diff -ur test/ref/DCP/dcp_test2 $work/DCP/dcp_test2
59 if [ "$?" != "0" ]; then
60 echo "FAIL: files differ"
64 # Check the DCP written by dcp_test5
65 diff -ur test/ref/DCP/dcp_test5 $work/DCP/dcp_test5
66 if [ "$?" != "0" ]; then
67 echo "FAIL: files differ"
71 # Check the DCP written by dcp_test7
72 diff -ur test/ref/DCP/dcp_test7 $work/DCP/dcp_test7
73 if [ "$?" != "0" ]; then
74 echo "FAIL: files differ"
78 # Check the DCP written by encryption_test
79 diff -ur test/ref/DCP/encryption_test $work/DCP/encryption_test
80 if [ "$?" != "0" ]; then
81 echo "FAIL: files differ"
85 # Everything beyond this point needs $private to exist
86 if [ ! -e "$private/info.log" ]; then
88 echo "Private data not found: some tests will not run."
92 # Run dcpinfo on all the DCPs in private/metadata, writing $work/info.log
93 # This writes details of the CPLs and all subtitle details, so it checks
94 # if the code is reading subtitle files correctly.
96 for d in `find $private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do
97 if [ `basename $d` != ".git" ]; then
98 $dcpinfo --ignore-missing-assets -s $d >> $work/info.log
99 if [ "$?" != "0" ]; then
100 echo "FAIL: dcpinfo failed for $d"
106 # Run dcpverify on all the DCPs in private/metadata
107 for d in `find $private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do
108 if [ `basename $d` != ".git" ]; then
109 $dcpverify --ignore-missing-assets --ignore-bv21-smpte -q $d
110 if [ "$?" != "0" ]; then
111 echo "FAIL: dcpverify failed for $d"
117 # Check info.log is what it should be
118 diff -q $work/info.log $private/info.log
119 if [ "$?" != "0" ]; then
120 echo "FAIL: dcpinfo output incorrect"
124 # Copy $private/metadata into build/metadata then re-write the subtitles
125 # of every DCP using $work/rewrite_subs. This tests round-trip of
126 # subtitle reading/writing.
127 rm -f $work/info2.log
130 cp -r $private/metadata $work/private/
131 for d in `find $work/private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do
132 if [ `basename $d` != ".git" ]; then
133 $work/rewrite_subs $d
134 $dcpinfo --ignore-missing-assets -s $d >> $work/info2.log
139 sed -i -e "s/DCP: build\/test/DCP: test/g" $work/info2.log
142 diff -q $work/info2.log $private/info2.log
143 if [ "$?" != "0" ]; then
144 echo "FAIL: dcpinfo output from rewrite incorrect"
148 # Dump the subs of JourneyToJah... (which has MXF-wrapped SMPTE subtitles)
149 # and check that they are right
150 $dcpinfo -s $private/data/JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV >> $work/jah.log
152 # Parse some problematic subs and check that we get it right
153 run/test/subs_in_out $private/TunaBoat_Icelandic_Reel1_V1_8sec.xml > $work/tuna.xml
154 diff -q $private/TunaBoat_Icelandic_Reel1_V1_8sec.parsed.xml $work/tuna.xml
155 if [ "$?" != "0" ]; then
156 echo "FAIL: output of parse check 1 invalid"