Fix incorrect free and leak.
[libdcp.git] / run-tests.sh
index b9e6d75c472d1c3696177bbc30012b3a064eb224..9456273a9c93c5ea2e2c408e486068091aa5baac 100755 (executable)
@@ -8,6 +8,11 @@
 # 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
@@ -32,12 +37,7 @@ fi
 
 rm -f build/test/info.log
 
-if [ ! -e "../libdcp-test" ]; then
-  echo "Test corpus not found"
-  exit 1
-fi
-
-for d in `find ../libdcp-test -mindepth 1 -maxdepth 1 -type d`; do
+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
     if [ "$?" != "0" ]; then
@@ -57,7 +57,7 @@ rm -f build/test/info2.log
 rm -rf build/test/libdcp-test
 
 cp -r ../libdcp-test build/test
-for d in `find build/test/libdcp-test -mindepth 1 -maxdepth 1 -type d`; do
+for d in `find build/test/libdcp-test -mindepth 1 -maxdepth 1 -type d | sort`; do
   if [ `basename $d` != ".git" ]; then
     LD_LIBRARY_PATH=build/src:build/asdcplib/src build/test/rewrite_subs $d
     LD_LIBRARY_PATH=build/src:build/asdcplib/src build/tools/dcpinfo -s $d >> build/test/info2.log
@@ -71,5 +71,11 @@ if [ "$?" != "0" ]; then
   echo "FAIL: dcpinfo output from rewrite incorrect"
   exit 1
 fi
+
+diff build/test/baz/video1.mxf build/test/baz/video2.mxf
+if [ "$?" != "0" ]; then
+  echo "FAIL: MXFs from recovery incorrect"
+  exit 1
+fi
     
 echo "PASS"