Skip to content

Commit

Permalink
Add some failing tests to the alias field
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Oct 21, 2019
1 parent 91cc9c5 commit 2014e73
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,14 @@
test-cases/github2629
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name github2681)
(deps (package dune) (source_tree test-cases/github2681))
(action
(chdir
test-cases/github2681
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name github534)
(deps (package dune) (source_tree test-cases/github534))
Expand Down Expand Up @@ -1950,6 +1958,7 @@
(alias github25)
(alias github2584)
(alias github2629)
(alias github2681)
(alias github534)
(alias github568)
(alias github597)
Expand Down Expand Up @@ -2166,6 +2175,7 @@
(alias github25)
(alias github2584)
(alias github2629)
(alias github2681)
(alias github534)
(alias github568)
(alias github597)
Expand Down
37 changes: 37 additions & 0 deletions test/blackbox-tests/test-cases/github2681/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
A rule may have an alias field. This denotes that the action of the rule is a
dependency of the alias.
$ mkdir simple && cd simple
$ cat > dune-project <<EOF
> (lang dune 2.0)
> EOF
$ cat > dune <<EOF
> (rule
> (action (with-stdout-to foo (echo "hello world")))
> (alias bar))
> EOF
$ dune build @bar --display short
File "dune", line 2, characters 9-50:
2 | (action (with-stdout-to foo (echo "hello world")))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Rule has targets in different directories.
Targets:
- _build/.aliases/default/bar-fc3cef760337ee5dd7a56722c8e58053
- _build/default/foo
[1]

The field order should not affect the alias field:
$ cd .. && mkdir field-order && cd field-order
$ cat > dune-project <<EOF
> (lang dune 2.0)
> EOF
$ cat > dune <<EOF
> (rule
> (alias bar)
> (action (with-stdout-to foo (echo "hello world"))))
> EOF
$ dune build
File "dune", line 2, characters 2-7:
2 | (alias bar)
^^^^^
Error: Unknown action or rule field.
[1]

0 comments on commit 2014e73

Please sign in to comment.