Add VERBOSE=fail to "make tests", based on suggestion from Johan Bergstr?m.
authorRob Landley <rob@landley.net>
Sat, 30 Aug 2014 18:03:40 +0000 (13:03 -0500)
committerRob Landley <rob@landley.net>
Sat, 30 Aug 2014 18:03:40 +0000 (13:03 -0500)
scripts/test/testing.sh

index b7eacc6..ea2d6c4 100644 (file)
@@ -7,6 +7,7 @@
 # The following environment variables enable optional behavior in "testing":
 #    DEBUG - Show every command run by test script.
 #    VERBOSE - Print the diff -u of each failed test case.
+#              If equal to "fail", stop after first failed test.
 #    SKIP - do not perform this test (this is set by "optionflag")
 #
 # The "testing" function takes five arguments:
@@ -83,6 +84,7 @@ testing ()
     then
       echo "echo '$5' | $2"
       diff -u expected actual
+      [ "$VERBOSE" == fail ] && exit 1
     fi
   else
     echo "PASS: $NAME"