Fix incorrect free and leak.
[libdcp.git] / run-tests.sh
index 7ed965cfdff79e46ea265bbd4f82ff5dffb0f7e9..9456273a9c93c5ea2e2c408e486068091aa5baac 100755 (executable)
@@ -1,12 +1,18 @@
-#!/bin/bash
+#!/bin/bash -e
 
 #
-# Runs our test suite, which builds a DCP.
-# The output is compared against the one
+# Runs our test suite, which (amongst other things)
+# builds a couple of DCPs.
+# The outputs are compared against the ones
 # in test/ref/DCP, and an error is given
 # if anything is different.
 #
 
+if [ ! -e "../libdcp-test" ]; then
+  echo "Test corpus not found"
+  exit 1
+fi
+
 if [ "$1" == "--debug" ]; then
   shift
   LD_LIBRARY_PATH=build/src:build/asdcplib/src gdb --args build/test/tests
@@ -16,19 +22,21 @@ elif [ "$1" == "--valgrind" ]; then
 else
   LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/tests
 fi
-diff -ur test/ref/DCP build/test/foo
+
+diff -ur test/ref/DCP/foo build/test/foo
 if [ "$?" != "0" ]; then
   echo "FAIL: files differ"
   exit 1
 fi
 
-rm -f build/test/info.log
-
-if [ ! -e "../libdcp-test" ]; then
-  echo "Test corpus not found"
+diff -ur test/ref/DCP/bar build/test/bar
+if [ "$?" != "0" ]; then
+  echo "FAIL: files differ"
   exit 1
 fi
 
+rm -f build/test/info.log
+
 for d in `find ../libdcp-test -mindepth 1 -maxdepth 1 -type d | sort`; do
   if [ `basename $d` != ".git" ]; then
     LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo -s $d >> build/test/info.log