From 9f619a46b2a8aff239d5fee8e3be2d2279a6aea8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 17 Jul 2022 19:04:04 -0700 Subject: [PATCH] test: compare the results and error --- test/run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/run.sh b/test/run.sh index 1e4014cb6..a263a8b37 100755 --- a/test/run.sh +++ b/test/run.sh @@ -93,11 +93,16 @@ echo "Capturing screen shot..." import -window root ${ARG_OUT} echo "Comparing results..." -DIFF=$(compare -metric AE ${ARG_OUT} ${ARG_CASE}.png null:) +DIFF=$(compare -metric AE ${ARG_OUT} ${ARG_CASE}.png null: 2>&1) if [ $? -eq 2 ] ; then - printf " Comparison failed (error)" + echo " Comparison failed (error)" + exit 1 else - printf " Diff: ${DIFF}" + echo " Diff: ${DIFF}" + if [ $DIFF -gt 0 ]; then + echo " Diff is too high. Failure." + exit 1 + fi fi echo "Done"