Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
The symptoms are a bit different depending on the presence of an
interface file.
  • Loading branch information
emillon committed Apr 4, 2018
1 parent 126c91f commit f6f66a6
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/blackbox-tests/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,23 @@
(progn
(run ${exe:cram.exe} run.t)
(diff? run.t run.t.corrected))))))

(alias
((name runtest)
(deps ((package jbuilder)
(files_recursively_in test-cases/github660)))
(action
(chdir test-cases/github660
(progn
(run ${exe:cram.exe} run.t)
(diff? run.t run.t.corrected))))))

(alias
((name runtest)
(deps ((package jbuilder)
(files_recursively_in test-cases/github660-no-interface)))
(action
(chdir test-cases/github660-no-interface
(progn
(run ${exe:cram.exe} run.t)
(diff? run.t run.t.corrected))))))
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/github660-no-interface/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(jbuild_version 1)

(alias
((name runtest)
(deps (main.exe))
(action (run ${<}))))

(executable ((name main)))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Sub = Lib_sub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let hello = "hello"
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/github660-no-interface/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let () =
print_endline Lib.Sub.hello;
()
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/github660-no-interface/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$ jbuilder runtest --root . --display quiet -j1
main alias runtest
hello
$ echo 'let x = 1' >> lib_sub.ml
$ jbuilder runtest --root . --display quiet -j1 2>&1 | grep -v ocamlopt
File "_none_", line 1:
Error: Files .main.eobjs/main.cmx and .main.eobjs/lib_sub.cmx
make inconsistent assumptions over interface Lib_sub
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/github660/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(jbuild_version 1)

(alias
((name runtest)
(deps (main.exe))
(action (run ${<}))))

(executable ((name main)))
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github660/lib.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Sub = Lib_sub
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github660/lib.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module Sub = Lib_sub
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github660/lib_sub.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let hello = "hello"
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github660/lib_sub.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val hello : string
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/github660/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let () =
print_endline Lib.Sub.hello;
()
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/github660/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$ jbuilder runtest --root . --display quiet -j1
main alias runtest
hello
$ echo 'let x = 1' >> lib_sub.ml
$ jbuilder runtest --root . --display quiet -j1 2>&1 | grep -v ocamlopt
File "_none_", line 1:
Error: Files .main.eobjs/main.cmx and .main.eobjs/lib_sub.cmx
make inconsistent assumptions over implementation Lib_sub

0 comments on commit f6f66a6

Please sign in to comment.