5 # Private test data; this is stuff that is non-distributable
6 private=../libdcp-test-private
10 dcpinfo=build/tools/dcpinfo
12 export LD_LIBRARY_PATH=build/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
14 # Make sure we have the required tools
15 for c in xmlsec1 xmldiff; do
16 hash $c 2>/dev/null || { echo >&2 "$c required but not found; aborting"; exit 1; }
19 # Run the unit tests in test/
20 if [ "$1" == "--debug" ]; then
22 gdb --args $work/tests $private $*
23 elif [ "$1" == "--valgrind" ]; then
25 valgrind --tool="memcheck" $work/tests $private
26 elif [ "$1" == "--callgrind" ]; then
28 valgrind --tool="callgrind" $work/tests $private $*
30 $work/tests $private $*
31 if [ "$?" != "0" ]; then
32 echo "FAIL: unit tests"
37 # Check a MXF written by the unit tests
38 diff $work/baz/video1.mxf $work/baz/video2.mxf
39 if [ "$?" != "0" ]; then
40 echo "FAIL: MXFs from recovery incorrect"
44 # Check the DCP written by dcp_test1
45 diff -ur test/ref/DCP/dcp_test1 $work/DCP/dcp_test1
46 if [ "$?" != "0" ]; then
47 echo "FAIL: files differ"
51 # Check the DCP written by dcp_test2
52 diff -ur test/ref/DCP/dcp_test2 $work/DCP/dcp_test2
53 if [ "$?" != "0" ]; then
54 echo "FAIL: files differ"
58 # Check the DCP written by dcp_test5
59 diff -ur test/ref/DCP/dcp_test5 $work/DCP/dcp_test5
60 if [ "$?" != "0" ]; then
61 echo "FAIL: files differ"
65 # Check the DCP written by dcp_test7
66 diff -ur test/ref/DCP/dcp_test7 $work/DCP/dcp_test7
67 if [ "$?" != "0" ]; then
68 echo "FAIL: files differ"
72 # Check the DCP written by encryption_test
73 diff -ur test/ref/DCP/encryption_test $work/DCP/encryption_test
74 if [ "$?" != "0" ]; then
75 echo "FAIL: files differ"
79 # Everything beyond this point needs $private to exist
80 if [ ! -e "$private/info.log" ]; then
82 echo "Private data not found: some tests will not run."
86 # Run dcpinfo on all the DCPs in private/metadata, writing $work/info.log
87 # This writes details of the CPLs and all subtitle details, so it checks
88 # if the code is reading subtitle files correctly.
90 for d in `find $private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do
91 if [ `basename $d` != ".git" ]; then
92 $dcpinfo --ignore-missing-assets -k -s $d >> $work/info.log
93 if [ "$?" != "0" ]; then
94 echo "FAIL: dcpinfo failed for $d"
100 # Check info.log is what it should be
101 diff -q $work/info.log $private/info.log
102 if [ "$?" != "0" ]; then
103 echo "FAIL: dcpinfo output incorrect"
107 # Copy $private into build/ then re-write the subtitles of every DCP using
108 # $work/rewrite_subs. This tests round-trip of subtitle reading/writing.
109 # Note that all the subs in $private/metadata are Interop.
110 rm -f $work/info2.log
113 cp -r $private/* $work/private
114 for d in `find $work/private/metadata -mindepth 1 -maxdepth 1 -type d | sort -f -d`; do
115 if [ `basename $d` != ".git" ]; then
116 $work/rewrite_subs $d
117 $dcpinfo --ignore-missing-assets -k -s $d >> $work/info2.log
122 sed -i "s/DCP: build\/test/DCP: test/g" $work/info2.log
125 diff -q $work/info2.log $private/info2.log
126 if [ "$?" != "0" ]; then
127 echo "FAIL: dcpinfo output from rewrite incorrect"
131 # Dump the subs of JourneyToJah... (which has MXF-wrapped SMPTE subtitles)
132 # and check that they are right
133 $dcpinfo -s $private/data/JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV >> $work/jah.log
135 # Parse some problematic subs and check that we get it right
136 run/test/subs_in_out $private/TunaBoat_Icelandic_Reel1_V1_8sec.xml > $work/tuna.xml
137 diff -q $private/TunaBoat_Icelandic_Reel1_V1_8sec.parsed.xml $work/tuna.xml
138 if [ "$?" != "0" ]; then
139 echo "FAIL: output of parse check 1 invalid"