Skip to content

Commit 497ea77

Browse files
committed
Generate dune stanzas dynamically for an opam-less version test
1 parent 61252c2 commit 497ea77

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/dynarray/dune

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
;; Tests of the Dynarray library - added in 5.2
1+
(* -*- tuareg -*- *)
22

3+
(* We generate an appropriate dune stanza to avoid Dynarray tests build failures
4+
on 5.0 and 5.1 with the opam-less CI GitHub action setup *)
5+
6+
let at_least_52 = Sys.(ocaml_release.major,ocaml_release.minor) >= (5,2)
7+
8+
let dune =
9+
if at_least_52
10+
then Printf.sprintf {|
311
(test
412
(name lin_tests)
513
(modules lin_tests)
614
(package multicoretests)
715
(libraries qcheck-lin.domain)
8-
(action (run %{test} --verbose))
9-
(enabled_if (>= %{ocaml_version} 5.2))
16+
(action (run %%{test} --verbose))
1017
)
1118

1219
(test
1320
(name stm_tests)
1421
(modules stm_tests)
1522
(package multicoretests)
1623
(libraries qcheck-stm.sequential qcheck-stm.domain)
17-
(action (run %{test} --verbose))
18-
(enabled_if (>= %{ocaml_version} 5.2))
24+
(action (run %%{test} --verbose))
1925
)
26+
|}
27+
else
28+
Printf.sprintf {|
29+
(rule
30+
(alias runtest)
31+
(package multicoretests)
32+
(action (echo "Dynarray tests disabled as Dynarray is not available\n")))
33+
|}
34+
35+
let () = Jbuild_plugin.V1.send dune

0 commit comments

Comments
 (0)