From fa68f83355ecca1f72f4593a1ed0422fa8fcb6a6 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Sat, 28 Sep 2024 22:04:31 +0000
Subject: [PATCH] testsuite: skip ghc api tests that attempt to spawn processes
 inside wasm

This commit skips a few ghc api tests on wasm, since they would
attempt to spawn processes inside wasm, which is not supported at all.
---
 testsuite/tests/annotations/should_run/all.T | 1 +
 testsuite/tests/driver/all.T                 | 3 ++-
 testsuite/tests/ghc-api/all.T                | 2 ++
 testsuite/tests/ghc-api/dynCompileExpr/all.T | 1 +
 testsuite/tests/ghci/linking/dyn/all.T       | 1 +
 testsuite/tests/quasiquotation/all.T         | 2 +-
 6 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/testsuite/tests/annotations/should_run/all.T b/testsuite/tests/annotations/should_run/all.T
index bea2a3f3327..d96c3814223 100644
--- a/testsuite/tests/annotations/should_run/all.T
+++ b/testsuite/tests/annotations/should_run/all.T
@@ -9,6 +9,7 @@ setTestOpts(when(fast(), skip))
 test('annrun01',
      [extra_files(['Annrun01_Help.hs']),
       req_th,
+      req_process,
       js_broken(23013), # strangely, the workaround for #23013 triggers
                         # a call to an undefined FFI function in bytestring.
                         # Before, it was slow but not failing.
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 5a29f701d24..770306a7d74 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -131,7 +131,8 @@ test('dynHelloWorld',
      [''])
 
 test('T5313',
-     [ req_rts_linker, extra_run_opts('"' + config.libdir + '"')],
+     [ req_process,
+       req_rts_linker, extra_run_opts('"' + config.libdir + '"')],
      compile_and_run,
      ['-package ghc'])
 
diff --git a/testsuite/tests/ghc-api/all.T b/testsuite/tests/ghc-api/all.T
index 34ea1b84c6c..daf56cd2dd3 100644
--- a/testsuite/tests/ghc-api/all.T
+++ b/testsuite/tests/ghc-api/all.T
@@ -10,6 +10,7 @@ test('T9595', [extra_run_opts('"' + config.libdir + '"')],
               compile_and_run,
               ['-package ghc'])
 test('T10508_api', [ extra_run_opts('"' + config.libdir + '"'),
+                     req_process,
                      req_rts_linker ],
                    compile_and_run,
                    ['-package ghc'])
@@ -24,6 +25,7 @@ test('T11579', [extra_run_opts('"' + config.libdir + '"'), js_skip], compile_and
 test('T12099', normal, compile_and_run, ['-package ghc'])
 test('T18181',
      [ extra_run_opts('"' + config.libdir + '"'),
+       req_process,
        req_rts_linker],
      compile_and_run,
      ['-package ghc'])
diff --git a/testsuite/tests/ghc-api/dynCompileExpr/all.T b/testsuite/tests/ghc-api/dynCompileExpr/all.T
index d067e690e24..c33fe640246 100644
--- a/testsuite/tests/ghc-api/dynCompileExpr/all.T
+++ b/testsuite/tests/ghc-api/dynCompileExpr/all.T
@@ -1,5 +1,6 @@
 test('dynCompileExpr',
      [ extra_run_opts('"' + config.libdir + '"'),
        when(opsys('mingw32'), expect_broken_for(5987, ['dyn'])),
+       req_process,
        req_rts_linker, omit_ways(prof_ways) ], # cannot run interpreted code with -prof
      compile_and_run, ['-package ghc'])
diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T
index ee8548861fe..b215f6b7202 100644
--- a/testsuite/tests/ghci/linking/dyn/all.T
+++ b/testsuite/tests/ghci/linking/dyn/all.T
@@ -58,6 +58,7 @@ test('T13606', [unless(doing_ghci, skip), unless(opsys('mingw32'), skip),
 test('T3372',
      [unless(doing_ghci, skip),
       req_rts_linker,
+      req_process,
       extra_run_opts('"' + config.libdir + '"'),
       unless(config.have_RTS_linker, skip),
       # Concurrent GHC sessions is fragile on Windows since we must lock the
diff --git a/testsuite/tests/quasiquotation/all.T b/testsuite/tests/quasiquotation/all.T
index 4029fdb00ae..875d38a6016 100644
--- a/testsuite/tests/quasiquotation/all.T
+++ b/testsuite/tests/quasiquotation/all.T
@@ -2,7 +2,7 @@ test('T3953', req_th, compile_fail, [''])
 test('T4150', [expect_broken(4150)], makefile_test, ['T4150'])
 test('T5204', req_th, compile_fail, [''])
 test('T7918',
-     [req_interp, extra_run_opts('"' + config.libdir + '"'),
+     [req_interp, req_process, extra_run_opts('"' + config.libdir + '"'),
       only_ways([config.ghc_th_way]), unless(have_dynamic(), skip)],
      compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
 test('T14028',
-- 
GitLab