summaryrefslogtreecommitdiff
path: root/patches/packages-haskell-ghc-9.14.1-testsuite-skip-test-flag.diff
blob: 5702f01b0915f138d99b70458618ad0bc1a26e0e (plain)
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
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!