Return error for test files without any validation condition
authorHugo Villeneuve <hugo@hugovil.com>
Sun, 26 Jan 2014 04:39:27 +0000 (23:39 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Sun, 26 Jan 2014 04:39:27 +0000 (23:39 -0500)
tests/opcodes.sh

index 3ae17fd..57ff3db 100755 (executable)
@@ -17,8 +17,12 @@ if test $? -ne 0 ; then
     return 1
 fi
 
+test_output_found=0
+
 while read line; do
     if echo ${line} | grep -q "; Test output"; then
+        test_output_found=1
+
         test_str=$(echo ${line} | sed "s/^; Test output: //")
 
         if ! grep -q "${test_str}" ${lf}; then
@@ -28,4 +32,9 @@ while read line; do
     fi
 done < ${name}.asm
 
+if [ x"${test_output_found}" == x0 ]; then
+    # Need at least one test output condition to verify correct operation
+    exit 1
+fi
+
 exit 0