From 411e602d134aba05a8d876da41e8abe1b04c374c Mon Sep 17 00:00:00 2001 From: Sergey Avseyev Date: Mon, 25 May 2015 21:16:35 +0300 Subject: Introduce pedantic mode for tester Motivation ---------- External tools need to know whether or not any test in suite failed. For example buildbot, or packaging tool would like to stop the execution and mark it as failed if some tests does not pass. Modification ------------ Add `--pedantic` switch to tester program which will force it to quit with non-zero exit code if at least one failure detected. Also update `tests()` proc in koch to inspect result from tester and propagate it to user. Result ------ Nothing has changed in default behaviour. But following invocations will exit with non-zero code if there failed tests: ./koch tests --pedantic all ./tests/testament/tester --pedantic all --- koch.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'koch.nim') diff --git a/koch.nim b/koch.nim index 55019b544..a951b422f 100644 --- a/koch.nim +++ b/koch.nim @@ -333,8 +333,10 @@ proc tests(args: string) = # taint mode test :-) exec "nim cc --taintMode:on tests/testament/tester" let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe) - exec tester & " " & (args|"all") + let success = tryExec tester & " " & (args|"all") exec tester & " html" + if not success: + quit("tests failed", QuitFailure) proc temp(args: string) = var output = "compiler" / "nim".exe -- cgit 1.4.1-2-gfad0