diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-05-20 09:55:40 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-21 06:23:26 -0400 |
commit | ec10cc972ad685e8c2df519a5a300c229de67fd6 (patch) | |
tree | 360cad870df52923cb0fc35e76119d49d80a5553 /hadrian | |
parent | d9eb8bbf38cda5b6c885fad8ae8addea3325ce42 (diff) | |
download | haskell-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)
```
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/src/Builder.hs | 5 |
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 |