Skip to content

Commit

Permalink
Add test case for bug 2206
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 May 29, 2019
1 parent 310f1e1 commit d79fe8b
Show file tree
Hide file tree
Showing 8 changed files with 34 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 @@ -659,6 +659,14 @@
test-cases/github2123
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

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

(alias
(name github24)
(deps (package dune) (source_tree test-cases/github24))
Expand Down Expand Up @@ -1557,6 +1565,7 @@
(alias github2033)
(alias github2061)
(alias github2123)
(alias github2206)
(alias github24)
(alias github25)
(alias github534)
Expand Down Expand Up @@ -1733,6 +1742,7 @@
(alias github2033)
(alias github2061)
(alias github2123)
(alias github2206)
(alias github24)
(alias github25)
(alias github534)
Expand Down
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/github2206/copy_files/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(copy_files sources/*)

(executable
(name foo)
(preprocess (action (run %{project_root}/pp.exe %{input-file}))))
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/github2206/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(executable
(name pp))
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github2206/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 1.10)
7 changes: 7 additions & 0 deletions test/blackbox-tests/test-cases/github2206/pp.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let file = Sys.argv.(1)

let () =
let ch = open_in file in
let s = really_input_string ch (in_channel_length ch) in
close_in_noerr ch;
print_string s
9 changes: 9 additions & 0 deletions test/blackbox-tests/test-cases/github2206/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
copy_files would break the generation of the preprocessing flags
$ dune build copy_files/.merlin
File "copy_files/dune", line 5, characters 21-63:
5 | (preprocess (action (run %{project_root}/pp.exe %{input-file}))))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning: .merlin generated is inaccurate. Cannot mix preprocessed and non preprocessed specificiations.
Split the stanzas into different directories or silence this warning by adding (allow_approximate_merlin) to your dune-project.
$ cat copy_files/.merlin | grep "FLG -pp"
[1]

0 comments on commit d79fe8b

Please sign in to comment.