Skip to content

Commit

Permalink
[Promote] Separate and move the tests in there own directory
Browse files Browse the repository at this point in the history
Signed-off-by: François Bobot <[email protected]>
  • Loading branch information
bobot committed Sep 25, 2020
1 parent cda8b2a commit 791f4f7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/promote/non-existent.t/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(rule (with-stdout-to x.gen (echo "toto")))

(rule
(alias blah-non-existent)
(action (diff x-non-existent x.gen)))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 2.8)
18 changes: 18 additions & 0 deletions test/blackbox-tests/test-cases/promote/non-existent.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Tests for promoting with non existent reference
-----------------------------------------------
# Diffing should do as if it is an empty file

$ cat x-non-existent
cat: x-non-existent: No such file or directory
[1]

$ dune build @blah-non-existent
File "x-non-existent", line 1, characters 0-0:
Error: Files _build/default/x-non-existent and _build/default/x.gen differ.
[1]

$ dune promote
Promoting _build/default/x.gen to x-non-existent.

$ cat x-non-existent
toto
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
(name blah)
(action (diff x x.gen)))

(alias
(name blah-non-existent)
(action (diff x-non-existent x.gen)))

(rule (with-stdout-to x.gen.copy (cat x.gen)))

(rule (with-stdout-to y.gen (echo "titi")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@ General tests

$ printf titi > x

$ dune build @blah @blah-non-existent
$ dune build @blah
File "x", line 1, characters 0-0:
Error: Files _build/default/x and _build/default/x.gen differ.
File "x-non-existent", line 1, characters 0-0:
Error: Files _build/default/x-non-existent and _build/default/x.gen differ.
[1]
$ cat x
titi

$ dune promote
Promoting _build/default/x.gen to x.
Promoting _build/default/x.gen to x-non-existent.
$ cat x
toto
$ cat x-non-existent
toto

$ dune build @blah
$ cat x
Expand Down

0 comments on commit 791f4f7

Please sign in to comment.