Add a test corpus for XML.
[libdcp.git] / run-tests.sh
1 #!/bin/bash
2
3 #
4 # Runs our test suite, which builds a DCP.
5 # The output is compared against the one
6 # in test/ref/DCP, and an error is given
7 # if anything is different.
8 #
9
10 if [ "$1" == "--debug" ]; then
11   shift
12   LD_LIBRARY_PATH=build/src:build/asdcplib/src gdb --args build/test/tests
13 else
14   LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/tests
15 fi
16 diff -ur test/ref/DCP build/test/foo
17 if [ "$?" != "0" ]; then
18   echo "FAIL: files differ"
19   exit 1
20 fi
21
22 if [ -e "../libdcp-test" ]; then
23   for d in `find ../libdcp-test -mindepth 1 -maxdepth 1 -type d`; do
24     LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo $d
25     if [ "$?" != "0" ]; then
26       echo "FAIL: dcpinfo failed"
27       exit 1
28     fi
29   done
30 else
31   echo "Test corpus not found"
32   exit 1
33 fi
34
35 echo "PASS"
36