Skip to content

Commit

Permalink
Use long-form target inference
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed May 12, 2020
1 parent 244d623 commit b6d2192
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 481 deletions.
8 changes: 3 additions & 5 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
(:standard -noassert))))

(rule
(targets ocamlformat-help.actual)
(action
(with-stdout-to
%{targets}
(run ocamlformat --help=plain))))
(with-stdout-to
ocamlformat-help.actual
(run ocamlformat --help=plain)))

(rule
(alias runtest)
Expand Down
18 changes: 6 additions & 12 deletions test/cli/dune
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@
(diff max_iter_1_failing.expected max_iter_1_failing.output)))

(rule
(targets conf_bad_version.output)
(deps
(source_tree roots/bad_version))
(action
Expand All @@ -411,7 +410,7 @@
;; (it contains the current git rev)
%{null}
(with-stdout-to
%{targets}
conf_bad_version.output
(with-stdin-from
sample/a.ml
(chdir
Expand All @@ -426,12 +425,11 @@
(diff conf_bad_version.expected conf_bad_version.output)))

(rule
(targets conf_malformed1.output)
(deps
(source_tree roots/malformed1))
(action
(with-outputs-to
%{targets}
conf_malformed1.output
(with-stdin-from
sample/a.ml
(chdir
Expand All @@ -446,12 +444,11 @@
(diff conf_malformed1.expected conf_malformed1.output)))

(rule
(targets conf_unknown_option.output)
(deps
(source_tree roots/unknown_option))
(action
(with-outputs-to
%{targets}
conf_unknown_option.output
(with-stdin-from
sample/a.ml
(chdir
Expand All @@ -466,12 +463,11 @@
(diff conf_unknown_option.expected conf_unknown_option.output)))

(rule
(targets conf_unknown_value.output)
(deps
(source_tree roots/unknown_value))
(action
(with-outputs-to
%{targets}
conf_unknown_value.output
(with-stdin-from
sample/a.ml
(chdir
Expand All @@ -486,12 +482,11 @@
(diff conf_unknown_value.expected conf_unknown_value.output)))

(rule
(targets env_unknown_option.output)
(deps
(source_tree roots/unknown_value))
(action
(with-outputs-to
%{targets}
env_unknown_option.output
(with-stdin-from
sample/a.ml
(setenv
Expand All @@ -507,12 +502,11 @@
(diff env_unknown_option.expected env_unknown_option.output)))

(rule
(targets env_unknown_value.output)
(deps
(source_tree roots/unknown_value))
(action
(with-outputs-to
%{targets}
env_unknown_value.output
(setenv
OCAMLFORMAT
"type-decl=unknown"
Expand Down
6 changes: 2 additions & 4 deletions test/failing/dune
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
(rule
(targets list_and_comments.ml.output)
(deps .ocamlformat)
(action
(with-outputs-to
%{targets}
(run %{bin:ocamlformat} %{dep:list_and_comments.ml}))))
(with-outputs-to list_and_comments.ml.output
(run %{bin:ocamlformat} %{dep:list_and_comments.ml}))))

(rule
(alias runtest)
Expand Down
3 changes: 1 addition & 2 deletions test/passing/dune
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
(include dune.inc)

(rule
(targets dune.inc.gen)
(deps
(source_tree .))
(action
(with-stdout-to
%{targets}
dune.inc.gen
(run ./gen/gen.exe))))

(rule
Expand Down
Loading

0 comments on commit b6d2192

Please sign in to comment.