Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-04-10 15:02:32 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-04-10 15:56:38 -0400
commit42d192af792f5890a6d707caee5cb3c910a5eb9b (patch)
tree2b886313d8cf6798169ee46cf0c0b2eae50a2f6f /progtest/bin
parent8a17d0c6c575be59ace4d6b45fc59f972058a0ea (diff)
downloadtame-42d192af792f5890a6d707caee5cb3c910a5eb9b.tar.gz
tame-42d192af792f5890a6d707caee5cb3c910a5eb9b.tar.bz2
tame-42d192af792f5890a6d707caee5cb3c910a5eb9b.zip
progtest: Exit with non-zero status on test failure
Not a very useful test runner if it doesn't ever fail, now is it? * Makefile.am (check): Invoke new test/runner-test. Depend on modindex. * bin/runner.js: Exit with non-zero status on assertion failure. * test/_stub: Add stub program with good and bad test cases to test exit code. * test/runner-test: Add system test.
Diffstat (limited to 'progtest/bin')
-rw-r--r--progtest/bin/runner.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/progtest/bin/runner.js b/progtest/bin/runner.js
index c6c5deb..4dddf20 100644
--- a/progtest/bin/runner.js
+++ b/progtest/bin/runner.js
@@ -33,4 +33,17 @@ const runner = require( '../src/env' ).console(
);
runner( case_yaml )
- .catch( e => console.error( e ) );
+ .then( results =>
+ {
+ const failed = results.some(
+ ( { failures } ) => failures.length
+ );
+
+ process.exit( +failed );
+ } )
+ .catch( e =>
+ {
+ console.error( e );
+ process.exit( 1 );
+ } );
+