Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb committed Feb 10, 2021
1 parent 9179732 commit 923a45c
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 40 deletions.
9 changes: 6 additions & 3 deletions test/blackbox-tests/test-cases/github1946.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ This test demonstrates that -ppx is no more missing when two stanzas are
in the same dune file, but require different ppx specifications

$ dune build @all --profile release
$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Usesppx1
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.usesppx1.objs/byte)
(S
Expand All @@ -17,7 +19,8 @@ in the same dune file, but require different ppx specifications
'library-name="usesppx1"'"))
(FLG (-open Usesppx1 -w -40)))
Usesppx2
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.usesppx2.objs/byte)
(S
Expand Down
18 changes: 12 additions & 6 deletions test/blackbox-tests/test-cases/github759.t/run.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$ dune build foo.cma --profile release
$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand All @@ -10,9 +12,11 @@

$ rm -f .merlin
$ dune build foo.cma --profile release
$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand All @@ -21,9 +25,11 @@

$ echo toto > .merlin
$ dune build foo.cma --profile release
$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand Down
6 changes: 4 additions & 2 deletions test/blackbox-tests/test-cases/merlin/github4125.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
..
lib-foo

$ dune ocaml-merlin --dump-config="$(pwd)"
$ dune ocaml-merlin --dump-config="$(pwd)" |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/cross/.foo.objs/byte)
(S
Expand Down
17 changes: 10 additions & 7 deletions test/blackbox-tests/test-cases/merlin/merlin-from-subdir.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ We build the project
bar

Verify that merlin configuration was generated...
$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Test
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(B
Expand All @@ -22,7 +24,8 @@ Verify that merlin configuration was generated...
-short-paths
-keep-locs)))
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand All @@ -44,12 +47,12 @@ Now we check that both querying from the root and the subfolder works
$ FILE=$(pwd)/foo.ml
$ FILE411=$(pwd)/411/test.ml

$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g"
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g" | sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
> (4:File${#FILE}:$FILE)
> EOF
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
((?:STDLIB?:OPAM_PREFIX/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))

$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g"
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g" | sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
> (4:File${#FILE411}:$FILE411)
> EOF
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
((?:STDLIB?:OPAM_PREFIX/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
24 changes: 16 additions & 8 deletions test/blackbox-tests/test-cases/merlin/merlin-tests.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ CRAM sanitization
$ dune ocaml-merlin --dump-config=$(pwd)/exe |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
X
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B OPAM_PREFIX/lib/bytes)
(B OPAM_PREFIX/lib/findlib)
(B OPAM_PREFIX/lib/ocaml)
Expand All @@ -27,7 +28,8 @@ CRAM sanitization
$ dune ocaml-merlin --dump-config=$(pwd)/lib |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
File
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/lib/.bar.objs/byte)
(S
Expand All @@ -42,7 +44,8 @@ CRAM sanitization
'library-name="bar"'"))
(FLG (-open Bar -w -40)))
Bar
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/lib/.bar.objs/byte)
(S
Expand All @@ -57,7 +60,8 @@ CRAM sanitization
'library-name="bar"'"))
(FLG (-open Bar -w -40)))
Privmod
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B OPAM_PREFIX/lib/bytes)
(B OPAM_PREFIX/lib/findlib)
(B OPAM_PREFIX/lib/ocaml)
Expand All @@ -78,7 +82,8 @@ CRAM sanitization
'library-name="foo"'"))
(FLG (-open Foo -w -40)))
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B OPAM_PREFIX/lib/bytes)
(B OPAM_PREFIX/lib/findlib)
(B OPAM_PREFIX/lib/ocaml)
Expand Down Expand Up @@ -108,7 +113,8 @@ Make sure pp flag is correct and variables are expanded
$ dune ocaml-merlin --dump-config=$(pwd)/pp-with-expand |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foobar
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/pp-with-expand/.foobar.eobjs/byte)
(S
Expand All @@ -124,7 +130,8 @@ Check hash of executables names if more than one
$ dune ocaml-merlin --dump-config=$(pwd)/exes |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Y
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/exes/.x.eobjs/byte)
(S
Expand All @@ -137,7 +144,8 @@ Check hash of executables names if more than one
-short-paths
-keep-locs)))
X
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/exes/.x.eobjs/byte)
(S
Expand Down
9 changes: 6 additions & 3 deletions test/blackbox-tests/test-cases/merlin/per-module-pp.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
We dump the config for Foo and Bar modules but the pp.exe preprocessor
should appear only once since only Foo is using it.

$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand All @@ -21,7 +23,8 @@ should appear only once since only Foo is using it.
-short-paths
-keep-locs)))
Bar
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(S
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/merlin/server.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

$ dune build @check

$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g"
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g" | sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
> (4:File${#FILE}:$FILE)
> EOF
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.main.eobjs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib3.objs/byte)(?:S?:$TESTCASE_ROOT)(?:FLG(?:-open?:Dune__exe?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
((?:STDLIB?:OPAM_PREFIX/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.main.eobjs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib3.objs/byte)(?:S?:$TESTCASE_ROOT)(?:FLG(?:-open?:Dune__exe?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))

$ FILE=$PWD/lib3.ml
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g"
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g" | sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
> (4:File${#FILE}:$FILE)
> EOF
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib3.objs/byte)(?:S?:$TESTCASE_ROOT)(?:FLG(?:-open?:Mylib?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
((?:STDLIB?:OPAM_PREFIX/lib/ocaml)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib3.objs/byte)(?:S?:$TESTCASE_ROOT)(?:FLG(?:-open?:Mylib?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ library also has more than one src dir.
> EOF

$ dune build lib2/.merlin-conf/lib-lib2
$ dune ocaml-merlin --dump-config=$(pwd)/lib2
$ dune ocaml-merlin --dump-config=$(pwd)/lib2 |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Lib2
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/lib1/.lib1.objs/byte)
(B
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
$ dune exec ./foo.exe
42

$ dune ocaml-merlin --dump-config=$(pwd)
$ dune ocaml-merlin --dump-config=$(pwd) |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.eobjs/byte)
(B
Expand All @@ -20,9 +22,11 @@
-short-paths
-keep-locs)))

$ dune ocaml-merlin --dump-config=$(pwd)/foo
$ dune ocaml-merlin --dump-config=$(pwd)/foo |
> sed 's#'$(opam config var prefix)'#OPAM_PREFIX#'
Bar
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/foo/.foo.objs/byte)
(S
Expand All @@ -37,7 +41,8 @@
-short-paths
-keep-locs)))
Foo
((EXCLUDE_QUERY_DIR)
((STDLIB OPAM_PREFIX/lib/ocaml)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/foo/.foo.objs/byte)
(S
Expand Down

0 comments on commit 923a45c

Please sign in to comment.