summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Main.hs12
-rw-r--r--src/Output.hs7
2 files changed, 13 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 253c1e8..8c50bce 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -218,22 +218,22 @@ main = do
Report {..} <- runTests out topts lmGlobalDefs tests
when (optReport opts) $ flip runReaderT out $ do
- outLineF OutputGlobalInfo Nothing $ "Total: " <> plainText (T.pack (show reportTotalCount))
- outLineF OutputGlobalInfo Nothing $ mconcat
+ outLineF OutputGlobalSummary Nothing $ "Total: " <> plainText (T.pack (show reportTotalCount))
+ outLineF OutputGlobalSummary Nothing $ mconcat
[ "Passed: "
, withStyle (if (reportPassedCount > 0) then setForegroundColor Green noStyle else noStyle) $
plainText $ T.pack $ show reportPassedCount
]
- outLineF OutputGlobalInfo Nothing $ mconcat
+ outLineF OutputGlobalSummary Nothing $ mconcat
[ "Failed: "
, withStyle (if (reportFailedCount > 0) then setForegroundColor Red noStyle else noStyle) $
plainText (T.pack (show reportFailedCount))
]
when (reportFailedCount > 0) $ do
- outLine OutputGlobalInfo Nothing ""
- outLineF OutputGlobalInfo Nothing $ withStyle (setForegroundColor BrightRed noStyle) $ "Failing tests:"
+ outLine OutputGlobalSummary Nothing ""
+ outLineF OutputGlobalSummary Nothing $ withStyle (setForegroundColor BrightRed noStyle) $ "Failing tests:"
forM_ reportFailedList $ \tname -> do
- outLineF OutputGlobalInfo Nothing $
+ outLineF OutputGlobalSummary Nothing $
withStyle (setForegroundColor Red noStyle) $
plainText $ textTestName tname
diff --git a/src/Output.hs b/src/Output.hs
index 84d6431..b28ad5c 100644
--- a/src/Output.hs
+++ b/src/Output.hs
@@ -57,6 +57,7 @@ data OutputStyle
data OutputType
= OutputGlobalInfo
| OutputGlobalError
+ | OutputGlobalSummary
| OutputChildStdout
| OutputChildStderr
| OutputChildStdin
@@ -92,6 +93,7 @@ outColor :: OutputType -> Text
outColor = \case
OutputGlobalInfo -> "0"
OutputGlobalError -> "31"
+ OutputGlobalSummary -> "0"
OutputChildStdout -> "0"
OutputChildStderr -> "31"
OutputChildStdin -> "0"
@@ -109,6 +111,7 @@ outSign :: OutputType -> Text
outSign = \case
OutputGlobalInfo -> ""
OutputGlobalError -> ""
+ OutputGlobalSummary -> ""
OutputChildStdout -> " "
OutputChildStderr -> "!"
OutputChildStdin -> T.empty
@@ -126,6 +129,7 @@ outArr :: OutputType -> Text
outArr = \case
OutputGlobalInfo -> ""
OutputGlobalError -> ""
+ OutputGlobalSummary -> ""
OutputChildStdin -> "<"
_ -> ">"
@@ -133,6 +137,7 @@ outTestLabel :: OutputType -> Text
outTestLabel = \case
OutputGlobalInfo -> "global-info"
OutputGlobalError -> "global-error"
+ OutputGlobalSummary -> "global-summary"
OutputChildStdout -> "child-stdout"
OutputChildStderr -> "child-stderr"
OutputChildStdin -> "child-stdin"
@@ -149,6 +154,7 @@ outTestLabel = \case
printWhenQuiet :: OutputType -> Bool
printWhenQuiet = \case
OutputGlobalError -> True
+ OutputGlobalSummary -> True
OutputChildStderr -> True
OutputChildFail -> True
OutputMatchFail {} -> True
@@ -160,6 +166,7 @@ includeTestTime :: OutputType -> Bool
includeTestTime = \case
OutputGlobalInfo -> False
OutputGlobalError -> False
+ OutputGlobalSummary -> False
_ -> True
ioWithOutput :: MonadOutput m => (Output -> IO a) -> m a