Add a test where an action modify one of its dependency (#923)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
Jérémie Dimino 2018-06-29 12:44:51 +01:00 committed by GitHub
parent 793a0b7c17
commit e886e948b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,11 @@
(alias
(name action-modifying-a-dependency)
(deps (package dune) (source_tree test-cases/action-modifying-a-dependency))
(action
(chdir
test-cases/action-modifying-a-dependency
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))
(alias
(name aliases)
(deps (package dune) (source_tree test-cases/aliases))
@ -566,6 +574,7 @@
(alias
(name runtest)
(deps
(alias action-modifying-a-dependency)
(alias aliases)
(alias bad-alias-error)
(alias block-strings)
@ -635,6 +644,7 @@
(alias
(name runtest-no-deps)
(deps
(alias action-modifying-a-dependency)
(alias aliases)
(alias bad-alias-error)
(alias block-strings)

View File

@ -0,0 +1 @@
hello

View File

@ -0,0 +1,5 @@
;; This test erroneously modify one of its dependencies
(alias
(name x)
(deps data (universe))
(action (system "echo hello >> data")))

View File

@ -0,0 +1 @@
(lang dune 1.0)

View File

@ -0,0 +1,22 @@
In this test the "x" alias depends on the file "data" but the action
associated to "x" appends a line to "data". The current behavior is
that the file in _build just keeps growing. The expected behavior is
an error from Dune telling the user that this is not allowed.
$ dune build @x
$ cat _build/default/data
hello
hello
$ dune build @x
$ cat _build/default/data
hello
hello
hello
$ dune build @x
$ cat _build/default/data
hello
hello
hello
hello