summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-20 09:55:40 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-05-20 09:58:11 +0100
commit82038ddfdc1a941a45470e9848f6320bb62faf38 (patch)
tree0c19347bc0626a1e6bb4102f066c549b5c6223f5
parent939a56e780b7cc55cf49b52c4222e0e8061e99b1 (diff)
downloadhaskell-wip/hadrian-testsuite-exit.tar.gz
hadrian: Reduce verbosity on failed testsuite runwip/hadrian-testsuite-exit
When the testsuite failed before it would print a big exception which gave you the very long command line which was used to invoke the testsuite. By capturing the exit code and rethrowing the exception, the error is must less verbose: ``` Error when running Shake build system: at want, called at src/Main.hs:104:30 in main:Main * Depends on: test * Raised the exception: user error (tests failed) ```
-rw-r--r--hadrian/src/Builder.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs
index aac3b26370..f2f69bb4ab 100644
--- a/hadrian/src/Builder.hs
+++ b/hadrian/src/Builder.hs
@@ -311,7 +311,10 @@ instance H.Builder Builder where
-- RunTest produces a very large amount of (colorised) output;
-- Don't attempt to capture it.
- RunTest -> cmd echo [path] buildArgs
+ RunTest -> do
+ Exit code <- cmd echo [path] buildArgs
+ when (code /= ExitSuccess) $ do
+ fail "tests failed"
_ -> cmd' echo [path] buildArgs