summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-20 09:55:40 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-21 06:23:26 -0400
commitec10cc972ad685e8c2df519a5a300c229de67fd6 (patch)
tree360cad870df52923cb0fc35e76119d49d80a5553
parentd9eb8bbf38cda5b6c885fad8ae8addea3325ce42 (diff)
downloadhaskell-ec10cc972ad685e8c2df519a5a300c229de67fd6.tar.gz
hadrian: Reduce verbosity on failed testsuite run
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