Mark tests that actually require multicore
authorStéphane Glondu <glondu@debian.org>
Wed, 26 Mar 2025 07:39:51 +0000 (08:39 +0100)
committerStéphane Glondu <glondu@debian.org>
Thu, 12 Jun 2025 12:08:28 +0000 (14:08 +0200)
Bug-Debian: https://bugs.debian.org/1101353
Forwarded: https://github.com/ocaml/ocaml/pull/13906

Gbp-Pq: Name 0008-Mark-tests-that-actually-require-multicore.patch

ocamltest/builtin_actions.ml
testsuite/tests/memory-model/forbidden.ml
testsuite/tests/memory-model/publish.ml
testsuite/tests/parallel/mctest.ml
testsuite/tests/parallel/pingpong.ml

index 0f06062f8b6cf0136493b22418f5e8060c7abaec..c1b783bf1fb187ef005348340fd16ff4c3f803a9 100644 (file)
@@ -102,6 +102,13 @@ let hasstr = make
     "str library available"
     "str library not available")
 
+let multicore = make
+  ~name:"multicore"
+  ~description:"Pass if running on multicore"
+  (Actions_helpers.pass_or_skip (Domain.recommended_domain_count () >= 2)
+    "running on multicore"
+    "not running on multicore")
+
 let windows_OS = "Windows_NT"
 
 let get_OS () = Sys.safe_getenv "OS"
@@ -367,6 +374,7 @@ let _ =
     hasunix;
     hassysthreads;
     hasstr;
+    multicore;
     libunix;
     libwin32unix;
     windows;
index 676904c15fef6130560b1371d0ef7f9c166866d6..daf65e5953693cd9d06f753a57f507fc73ebb431 100644 (file)
@@ -1,5 +1,6 @@
 (* TEST
  modules = "opt.ml barrier.ml hist.ml shared.ml run.ml outcome.ml";
+ multicore;
  not-bsd;
  no-tsan; (* tsan detects the intentional data races and fails *)
  {
index a857c6cf3ca5ec18990106b839e90d836b4236d7..cd000ef60cec449a14cfd01f9b9c909fdc24fe81 100644 (file)
@@ -1,5 +1,6 @@
 (* TEST
  modules = "opt.ml barrier.ml hist.ml shared.ml run.ml outcome.ml";
+ multicore;
  no-tsan; (* tsan detects data races and fails *)
  not-bsd;
  {
index ea339e31ed2c49044eb77461378d01d57bf4a3ed..8e2c51f6bf6ef79e8522571246566e809c812599 100644 (file)
@@ -1,5 +1,6 @@
 (* TEST
  include unix;
+ multicore;
  hasunix;
  {
    bytecode;
index eb43734aab6ce40071e457e369772a92c65ce44b..2508df5dd115cf791dc8743216dce84723b3478a 100644 (file)
@@ -1,4 +1,5 @@
 (* TEST
+ multicore;
  no-tsan; (* TSan detects the intentional data race *)
  {
    bytecode;