summaryrefslogtreecommitdiff
path: root/hadrian/src/CommandLine.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-01-18 12:14:03 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-09 02:53:05 -0500
commit2ac784ab381aae936ee3be7c8685e0203ee4dbf6 (patch)
treed8cb9280f1c30b6376a7e01a58d1f4b314bf9474 /hadrian/src/CommandLine.hs
parent1f630025d457807c4a9da513e4a0823e4643b2a6 (diff)
downloadhaskell-2ac784ab381aae936ee3be7c8685e0203ee4dbf6.tar.gz
hadrian: Add --test-metrics argument
Allowing the test metric output to be captured to a file, a la the METRIC_FILE environment variable of the make build system.
Diffstat (limited to 'hadrian/src/CommandLine.hs')
-rw-r--r--hadrian/src/CommandLine.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
index dcb42b8a32..afb791eb2a 100644
--- a/hadrian/src/CommandLine.hs
+++ b/hadrian/src/CommandLine.hs
@@ -52,6 +52,7 @@ data TestArgs = TestArgs
, testConfigFile :: String
, testConfigs :: [String]
, testJUnit :: Maybe FilePath
+ , testMetrics :: Maybe FilePath
, testOnly :: [String]
, testOnlyPerf :: Bool
, testSkipPerf :: Bool
@@ -71,6 +72,7 @@ defaultTestArgs = TestArgs
, testConfigFile = "testsuite/config/ghc"
, testConfigs = []
, testJUnit = Nothing
+ , testMetrics = Nothing
, testOnly = []
, testOnlyPerf = False
, testSkipPerf = False
@@ -143,6 +145,9 @@ readTestConfigFile filepath =
readTestJUnit :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readTestJUnit filepath = Right $ \flags -> flags { testArgs = (testArgs flags) { testJUnit = filepath } }
+readTestMetrics :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
+readTestMetrics filepath = Right $ \flags -> flags { testArgs = (testArgs flags) { testMetrics = filepath } }
+
readTestOnly :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readTestOnly tests = Right $ \flags ->
flags { testArgs = (testArgs flags) { testOnly = tests'' flags } }
@@ -240,6 +245,8 @@ optDescrs =
"Configurations to run test, in key=value format."
, Option [] ["summary-junit"] (OptArg readTestJUnit "TEST_SUMMARY_JUNIT")
"Output testsuite summary in JUnit format."
+ , Option [] ["summary-metrics"] (OptArg readTestMetrics "METRICS_FILE")
+ "Output testsuite performance metrics summary."
, Option [] ["only"] (OptArg readTestOnly "TESTS")
"Test cases to run."
, Option [] ["only-perf"] (NoArg readTestOnlyPerf)