From f6f66a6092fa962d957f4dc62064ad4725cdca92 Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Tue, 3 Apr 2018 10:25:31 +0200 Subject: [PATCH] Add tests The symptoms are a bit different depending on the presence of an interface file. --- test/blackbox-tests/jbuild | 20 +++++++++++++++++++ .../test-cases/github660-no-interface/jbuild | 8 ++++++++ .../test-cases/github660-no-interface/lib.ml | 1 + .../github660-no-interface/lib_sub.ml | 1 + .../test-cases/github660-no-interface/main.ml | 3 +++ .../test-cases/github660-no-interface/run.t | 8 ++++++++ .../test-cases/github660/jbuild | 8 ++++++++ .../test-cases/github660/lib.ml | 1 + .../test-cases/github660/lib.mli | 1 + .../test-cases/github660/lib_sub.ml | 1 + .../test-cases/github660/lib_sub.mli | 1 + .../test-cases/github660/main.ml | 3 +++ .../blackbox-tests/test-cases/github660/run.t | 8 ++++++++ 13 files changed, 64 insertions(+) create mode 100644 test/blackbox-tests/test-cases/github660-no-interface/jbuild create mode 100644 test/blackbox-tests/test-cases/github660-no-interface/lib.ml create mode 100644 test/blackbox-tests/test-cases/github660-no-interface/lib_sub.ml create mode 100644 test/blackbox-tests/test-cases/github660-no-interface/main.ml create mode 100644 test/blackbox-tests/test-cases/github660-no-interface/run.t create mode 100644 test/blackbox-tests/test-cases/github660/jbuild create mode 100644 test/blackbox-tests/test-cases/github660/lib.ml create mode 100644 test/blackbox-tests/test-cases/github660/lib.mli create mode 100644 test/blackbox-tests/test-cases/github660/lib_sub.ml create mode 100644 test/blackbox-tests/test-cases/github660/lib_sub.mli create mode 100644 test/blackbox-tests/test-cases/github660/main.ml create mode 100644 test/blackbox-tests/test-cases/github660/run.t diff --git a/test/blackbox-tests/jbuild b/test/blackbox-tests/jbuild index 01edbb921d2..2f8c72b0b4a 100644 --- a/test/blackbox-tests/jbuild +++ b/test/blackbox-tests/jbuild @@ -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)))))) diff --git a/test/blackbox-tests/test-cases/github660-no-interface/jbuild b/test/blackbox-tests/test-cases/github660-no-interface/jbuild new file mode 100644 index 00000000000..db41fcae766 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660-no-interface/jbuild @@ -0,0 +1,8 @@ +(jbuild_version 1) + +(alias + ((name runtest) + (deps (main.exe)) + (action (run ${<})))) + +(executable ((name main))) diff --git a/test/blackbox-tests/test-cases/github660-no-interface/lib.ml b/test/blackbox-tests/test-cases/github660-no-interface/lib.ml new file mode 100644 index 00000000000..e0c61ea9d8c --- /dev/null +++ b/test/blackbox-tests/test-cases/github660-no-interface/lib.ml @@ -0,0 +1 @@ +module Sub = Lib_sub diff --git a/test/blackbox-tests/test-cases/github660-no-interface/lib_sub.ml b/test/blackbox-tests/test-cases/github660-no-interface/lib_sub.ml new file mode 100644 index 00000000000..e33bd25c296 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660-no-interface/lib_sub.ml @@ -0,0 +1 @@ +let hello = "hello" diff --git a/test/blackbox-tests/test-cases/github660-no-interface/main.ml b/test/blackbox-tests/test-cases/github660-no-interface/main.ml new file mode 100644 index 00000000000..91f89a907df --- /dev/null +++ b/test/blackbox-tests/test-cases/github660-no-interface/main.ml @@ -0,0 +1,3 @@ +let () = + print_endline Lib.Sub.hello; + () diff --git a/test/blackbox-tests/test-cases/github660-no-interface/run.t b/test/blackbox-tests/test-cases/github660-no-interface/run.t new file mode 100644 index 00000000000..f6199689058 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660-no-interface/run.t @@ -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 diff --git a/test/blackbox-tests/test-cases/github660/jbuild b/test/blackbox-tests/test-cases/github660/jbuild new file mode 100644 index 00000000000..db41fcae766 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/jbuild @@ -0,0 +1,8 @@ +(jbuild_version 1) + +(alias + ((name runtest) + (deps (main.exe)) + (action (run ${<})))) + +(executable ((name main))) diff --git a/test/blackbox-tests/test-cases/github660/lib.ml b/test/blackbox-tests/test-cases/github660/lib.ml new file mode 100644 index 00000000000..e0c61ea9d8c --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/lib.ml @@ -0,0 +1 @@ +module Sub = Lib_sub diff --git a/test/blackbox-tests/test-cases/github660/lib.mli b/test/blackbox-tests/test-cases/github660/lib.mli new file mode 100644 index 00000000000..e0c61ea9d8c --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/lib.mli @@ -0,0 +1 @@ +module Sub = Lib_sub diff --git a/test/blackbox-tests/test-cases/github660/lib_sub.ml b/test/blackbox-tests/test-cases/github660/lib_sub.ml new file mode 100644 index 00000000000..e33bd25c296 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/lib_sub.ml @@ -0,0 +1 @@ +let hello = "hello" diff --git a/test/blackbox-tests/test-cases/github660/lib_sub.mli b/test/blackbox-tests/test-cases/github660/lib_sub.mli new file mode 100644 index 00000000000..addfd659520 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/lib_sub.mli @@ -0,0 +1 @@ +val hello : string diff --git a/test/blackbox-tests/test-cases/github660/main.ml b/test/blackbox-tests/test-cases/github660/main.ml new file mode 100644 index 00000000000..91f89a907df --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/main.ml @@ -0,0 +1,3 @@ +let () = + print_endline Lib.Sub.hello; + () diff --git a/test/blackbox-tests/test-cases/github660/run.t b/test/blackbox-tests/test-cases/github660/run.t new file mode 100644 index 00000000000..6f16f429d89 --- /dev/null +++ b/test/blackbox-tests/test-cases/github660/run.t @@ -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