Skip to content

Commit a83ced2

Browse files
Simplify test build
Thanks to @emillon for pointing out all the shortcut that dune allows to avoid declaring things over and over.
1 parent 3c8a9db commit a83ced2

File tree

1 file changed

+14
-26
lines changed
  • test/bin/mdx-dune-gen/misc/non-deterministic

1 file changed

+14
-26
lines changed

test/bin/mdx-dune-gen/misc/non-deterministic/dune

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
(rule
2-
(target dune_gen.ml)
3-
(action
4-
(with-stdout-to
5-
%{target}
6-
(run ocaml-mdx dune-gen))))
2+
(with-stdout-to
3+
dune_gen.ml
4+
(run ocaml-mdx dune-gen)))
75

86
(executable
97
(name dune_gen)
@@ -12,33 +10,23 @@
1210
(libraries mdx.test))
1311

1412
(rule
15-
(target dune-mdx-nondeterministic.deterministic)
16-
(deps
17-
dune_gen.exe
18-
(:input dune-mdx-nondeterministic))
19-
(action
20-
(with-stdout-to
21-
%{target}
22-
(run ./dune_gen.exe %{input}))))
13+
(with-stdout-to
14+
dune-mdx-nondeterministic.deterministic
15+
(run ./dune_gen.exe %{dep:dune-mdx-nondeterministic})))
2316

2417
(rule
25-
(target dune-mdx-nondeterministic.nondeterministic)
26-
(deps
27-
dune_gen.exe
28-
(:input dune-mdx-nondeterministic))
29-
(action
30-
(setenv
31-
MDX_RUN_NON_DETERMINISTIC
32-
1
33-
(with-stdout-to
34-
%{target}
35-
(run ./dune_gen.exe %{input})))))
18+
(setenv
19+
MDX_RUN_NON_DETERMINISTIC
20+
1
21+
(with-stdout-to
22+
dune-mdx-nondeterministic.nondeterministic
23+
(run ./dune_gen.exe %{dep:dune-mdx-nondeterministic}))))
3624

3725
(rule
3826
(alias runtest)
3927
(action
40-
(diff %{dep:dune-mdx-nondeterministic.expected}
41-
%{dep:dune-mdx-nondeterministic.deterministic})))
28+
(diff dune-mdx-nondeterministic.expected
29+
dune-mdx-nondeterministic.deterministic)))
4230

4331
;; make sure the non-deterministic is different from the deterministic
4432

0 commit comments

Comments
 (0)