X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=run-tests.sh;h=e08dc86d91e4d3ec8048c15febbb8ff6c15dbe74;hb=50b5f8f9df0439d2d8fa9004e0b4af2f3e1eb44c;hp=c75c8c2ad97a0515468025d1881d4fd6d9e1bd43;hpb=8f6f5c5c8f09d8aa880c3f2f29530744576212a1;p=libdcp.git diff --git a/run-tests.sh b/run-tests.sh index c75c8c2a..e08dc86d 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,8 +1,9 @@ #!/bin/bash # -# 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. # @@ -13,24 +14,59 @@ if [ "$1" == "--debug" ]; 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 + +diff -ur test/ref/DCP/bar build/test/bar if [ "$?" != "0" ]; then echo "FAIL: files differ" exit 1 fi -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 +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 + 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 - echo "FAIL: dcpinfo failed" + echo "FAIL: dcpinfo failed for $d" exit 1 fi - done -else - echo "Test corpus not found" + fi +done + +diff -q build/test/info.log ../libdcp-test/info.log +if [ "$?" != "0" ]; then + echo "FAIL: dcpinfo output incorrect" exit 1 fi -echo "PASS" +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 + 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 + fi +done +sed -i "s/DCP: build\/test/DCP: \.\./g" build/test/info2.log + +diff -q build/test/info2.log ../libdcp-test/info.log +if [ "$?" != "0" ]; then + echo "FAIL: dcpinfo output from rewrite incorrect" + exit 1 +fi + +echo "PASS"