summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff64
-rw-r--r--patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff50
2 files changed, 114 insertions, 0 deletions
diff --git a/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff b/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff
new file mode 100644
index 0000000..1a5a365
--- /dev/null
+++ b/patches/packages-haskell-ghc-9.14.1-src-skip-test-flag.diff
@@ -0,0 +1,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 \ No newline at end of file
diff --git a/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff b/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff
new file mode 100644
index 0000000..5702f01
--- /dev/null
+++ b/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff
@@ -0,0 +1,50 @@
+diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py
+index 36bc6a454a87..8d4a2a10c1b8 100644
+--- a/testsuite/driver/runtests.py
++++ b/testsuite/driver/runtests.py
+@@ -79,6 +79,7 @@ def get_compiler_info() -> TestConfig:
+ parser.add_argument("--unexpected-output-dir", help="directory in which to place unexpected output")
+ parser.add_argument("--target-wrapper", help="wrapper executable to use when executing binaries compiled for the target")
+ parser.add_argument("--only", action="append", help="just this test (can be give multiple --only= flags)")
++parser.add_argument("--skip", action="append", help="skip this test (can be given multiple --skip= flags)")
+ parser.add_argument("--way", action="append", help="just this way")
+ parser.add_argument("--skipway", action="append", help="skip this way")
+ parser.add_argument("--threads", type=int, help="threads to run simultaneously")
+@@ -135,6 +136,9 @@ def get_compiler_info() -> TestConfig:
+ config.only = args.only
+ config.run_only_some_tests = True
+
++if args.skip:
++ config.skip = set(args.skip)
++
+ if args.way:
+ for way in args.way:
+ if way not in all_ways:
+diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
+index b41a7e084dec..bff8e7d5d695 100644
+--- a/testsuite/driver/testglobals.py
++++ b/testsuite/driver/testglobals.py
+@@ -31,6 +31,9 @@ def __init__(self):
+ self.run_only_some_tests = False
+ self.only = set()
+
++ # Skip these tests
++ self.skip = set()
++
+ # Don't fail on out-of-tolerance stat failures
+ self.ignore_perf_increases = False
+ self.ignore_perf_decreases = False
+diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
+index c74f5d4346c9..97631734ac7e 100644
+--- a/testsuite/driver/testlib.py
++++ b/testsuite/driver/testlib.py
+@@ -1526,6 +1526,9 @@ def test(name: TestName,
+ # report on any tests we couldn't find and error out.
+ config.only.remove(name)
+
++ if name in config.skip:
++ return
++
+ # Make a deep copy of the default_testopts, as we need our own copy
+ # of any dictionaries etc inside it. Otherwise, if one test modifies
+ # them, all tests will see the modified version!