From 445b55b3e521d4b530c75e523f25d9885765347f Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 5 May 2017 18:11:33 +0200 Subject: [PATCH] test runner: non-zero exit code in case of failed tests This makes it easier to detect unit test failures from the command line. --- basis/tools/test/test.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/tools/test/test.factor b/basis/tools/test/test.factor index e8c8a1a922..f333c0e074 100644 --- a/basis/tools/test/test.factor +++ b/basis/tools/test/test.factor @@ -6,7 +6,7 @@ generalizations io io.files.temp io.files.unique kernel lexer locals macros namespaces parser prettyprint quotations sequences sequences.generalizations source-files source-files.errors source-files.errors.debugger splitting stack-checker summary -tools.errors unicode vocabs vocabs.files vocabs.metadata +system tools.errors unicode vocabs vocabs.files vocabs.metadata vocabs.parser words ; FROM: vocabs.hierarchy => load ; IN: tools.test @@ -193,6 +193,7 @@ M: test-failure error. ( error -- ) : test-all ( -- ) loaded-vocab-names filter-don't-test test-vocabs ; : test-main ( -- ) - command-line get [ [ load ] [ test ] bi ] each ; + command-line get [ [ load ] [ test ] bi ] each + test-failures get empty? [ 0 ] [ 1 ] if exit ; MAIN: test-main