1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
index 6b5688059158..39b5b475c52f 100644
--- a/hadrian/src/CommandLine.hs
+++ b/hadrian/src/CommandLine.hs
@@ -71,6 +71,7 @@ data TestArgs = TestArgs
, testJUnit :: Maybe FilePath
, testMetricsFile:: Maybe FilePath
, testOnly :: [String]
+ , testSkip :: [String]
, testOnlyPerf :: Bool
, testSkipPerf :: Bool
, testRootDirs :: [FilePath]
@@ -100,6 +101,7 @@ defaultTestArgs = TestArgs
, testJUnit = Nothing
, testMetricsFile= Nothing
, testOnly = []
+ , testSkip = []
, testOnlyPerf = False
, testSkipPerf = False
, testRootDirs = []
@@ -191,6 +193,13 @@ readTestOnly tests = Right $ \flags ->
where tests' = maybe [] words tests
tests'' flags = testOnly (testArgs flags) ++ tests'
+readTestSkip :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
+readTestSkip tests = Right $ \flags ->
+ flags { testArgs = (testArgs flags) { testSkip = tests'' flags } }
+
+ where tests' = maybe [] words tests
+ tests'' flags = testSkip (testArgs flags) ++ tests'
+
readTestOnlyPerf :: Either String (CommandLineArgs -> CommandLineArgs)
readTestOnlyPerf = Right $ \flags -> flags { testArgs = (testArgs flags) { testOnlyPerf = True } }
@@ -306,6 +315,8 @@ optDescrs =
"Output testsuite performance metrics summary."
, Option [] ["only"] (OptArg readTestOnly "TESTS")
"Test cases to run."
+ , Option [] ["skip-test"] (OptArg readTestSkip "TESTS")
+ "Test cases to skip."
, Option [] ["only-perf"] (NoArg readTestOnlyPerf)
"Only run performance tests."
, Option [] ["skip-perf"] (NoArg readTestSkipPerf)
diff --git a/hadrian/src/Settings/Builders/RunTest.hs b/hadrian/src/Settings/Builders/RunTest.hs
index 0531294ea961..b890282059b8 100644
--- a/hadrian/src/Settings/Builders/RunTest.hs
+++ b/hadrian/src/Settings/Builders/RunTest.hs
@@ -360,6 +360,7 @@ getTestArgs = do
haveDocs <- willDocsBeBuilt
let configFileArg= ["--config-file=" ++ (testConfigFile args)]
testOnlyArg = map ("--only=" ++) (testOnly args ++ testEnvTargets)
+ testSkipArg = map ("--skip=" ++) (testSkip args)
onlyPerfArg = if testOnlyPerf args
then Just "--only-perf-tests"
else Nothing
@@ -399,6 +400,6 @@ getTestArgs = do
inTreeArg = [ "-e", "config.in_tree_compiler=" ++
show (isInTreeCompiler (testCompiler args) || testHasInTreeFiles args) ]
- pure $ configFileArg ++ testOnlyArg ++ speedArg
+ pure $ configFileArg ++ testOnlyArg ++ testSkipArg ++ speedArg
++ catMaybes [ onlyPerfArg, skipPerfArg, summaryArg
, junitArg, metricsArg, verbosityArg ]
++ configArgs ++ wayArgs ++ compilerArg ++ ghcPkgArg
|