File tree 1 file changed +27
-5
lines changed
1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change 1
- ;; Tests of the Dynarray library - added in 5.2
1
+ (* -*- tuareg -*- *)
2
2
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
+ (* Use ocaml_version instead of ocaml_release (from 4.14) to support 4.12 opam install *)
7
+ let ocaml_version_pair =
8
+ let (major,minor) = match String.split_on_char '.' Sys.ocaml_version with
9
+ | major::minor::_ -> (major,minor)
10
+ | _ -> failwith "Unable to extract OCaml version" in
11
+ try (int_of_string major, int_of_string minor)
12
+ with Failure _ -> failwith "Failed to parse OCaml version"
13
+
14
+ let dune =
15
+ if ocaml_version_pair >= (5,2)
16
+ then Printf.sprintf {|
3
17
(test
4
18
(name lin_tests)
5
19
(modules lin_tests)
6
20
(package multicoretests)
7
21
(libraries qcheck-lin.domain)
8
- (action (run %{test} --verbose))
9
- (enabled_if (>= %{ocaml_version} 5.2))
22
+ (action (run %%{test} --verbose))
10
23
)
11
24
12
25
(test
13
26
(name stm_tests)
14
27
(modules stm_tests)
15
28
(package multicoretests)
16
29
(libraries qcheck-stm.sequential qcheck-stm.domain)
17
- (action (run %{test} --verbose))
18
- (enabled_if (>= %{ocaml_version} 5.2))
30
+ (action (run %%{test} --verbose))
19
31
)
32
+ |}
33
+ else
34
+ Printf.sprintf {|
35
+ (rule
36
+ (alias runtest)
37
+ (package multicoretests)
38
+ (action (echo "Dynarray tests disabled as Dynarray is not available\n")))
39
+ |}
40
+
41
+ let () = Jbuild_plugin.V1.send dune
You can’t perform that action at this time.
0 commit comments