summaryrefslogtreecommitdiff
path: root/run-tests.sh
blob: 2fb89317a3ff45021d042f6297c74391981f85e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

#
# Runs our test suite, which builds a DCP.
# The output is compared against the one
# in test/ref/DCP, and an error is given
# if anything is different.
#

if [ "$1" == "--debug" ]; then
  shift
  LD_LIBRARY_PATH=build/src:build/asdcplib/src gdb --args build/test/tests
else
  LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/tests
fi
diff -ur test/ref/DCP build/test/foo
if [ "$?" != "0" ]; then
  echo "FAIL: files differ"
  exit 1
fi

rm -f build/test/info.log

if [ -e "../libdcp-test" ]; then
  for d in `find ../libdcp-test -mindepth 1 -maxdepth 1 -type d`; do
    LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo $d >> build/test/info.log
    if [ "$?" != "0" ]; then
      echo "FAIL: dcpinfo failed"
      exit 1
    fi
  done
else
  echo "Test corpus not found"
  exit 1
fi

diff -q build/test/info.log test/ref/info.log
if [ "$?" != "0" ]; then
  echo "FAIL: dcpinfo output incorrect"
  exit 1
fi

echo "PASS"