-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdune
41 lines (36 loc) · 1.1 KB
/
dune
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
(* -*- tuareg -*- *)
(* We generate an appropriate dune stanza to avoid Dynarray tests build failures
on 5.0 and 5.1 with the opam-less CI GitHub action setup *)
(* Use ocaml_version instead of ocaml_release (from 4.14) to support 4.12 opam install *)
let ocaml_version_pair =
let (major,minor) = match String.split_on_char '.' Sys.ocaml_version with
| major::minor::_ -> (major,minor)
| _ -> failwith "Unable to extract OCaml version" in
try (int_of_string major, int_of_string minor)
with Failure _ -> failwith "Failed to parse OCaml version"
let dune =
if ocaml_version_pair >= (5,2)
then Printf.sprintf {|
(test
(name lin_tests)
(modules lin_tests)
(package multicoretests)
(libraries qcheck-lin.domain)
(action (run %%{test} --verbose))
)
(test
(name stm_tests)
(modules stm_tests)
(package multicoretests)
(libraries qcheck-stm.sequential qcheck-stm.domain)
(action (run %%{test} --verbose))
)
|}
else
Printf.sprintf {|
(rule
(alias runtest)
(package multicoretests)
(action (echo "Dynarray tests disabled as Dynarray is not available\n")))
|}
let () = Jbuild_plugin.V1.send dune