diff options
author | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-04-10 15:02:32 -0400 |
---|---|---|
committer | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-04-10 15:56:38 -0400 |
commit | 42d192af792f5890a6d707caee5cb3c910a5eb9b (patch) | |
tree | 2b886313d8cf6798169ee46cf0c0b2eae50a2f6f /progtest/bin | |
parent | 8a17d0c6c575be59ace4d6b45fc59f972058a0ea (diff) | |
download | tame-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.js | 15 |
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 ); + } ); + |