show diffs after demo failure. fixes
@@ -30,9 +30,13 @@ batfish -servicemode -register -coordinatorhost localhost -loglevel output &
echo -e "\n ..... Running java demo tests"
if ! batfish_client -cmdfile demos/example/commands -coordinatorhost localhost > demos/example/commands.ref.testout; then
echo "DEMO FAILED!" 1>&2
- exit 1
+ DEMO_FAILED=1
+else
+ if [ -n "$DEMO_FAILED" ]; then
+ unset DEMO_FAILED
fi
rm demos/example/commands.ref.testout
+fi
echo -e "\n .... Failed tests: "
$GNU_FIND -name *.testout
@@ -43,7 +47,7 @@ for i in $($GNU_FIND -name *.testout); do
done
#exit with exit code 1 if any test failed
-if [ -n "$($GNU_FIND -name '*.testout')" ]; then
+if [ -n "$($GNU_FIND -name '*.testout')" -o -n "$DEMO_FAILED" ]; then
exit 1
fi
