Skip to content

Commit

Permalink
Update tests with FLG
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysse Gérard <[email protected]>
  • Loading branch information
voodoos committed Aug 10, 2020
1 parent a577f02 commit 1c4533c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/github1946.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ dune file, but require different ppx specifications
$ dune build @all --profile release
$ cat _build/default/.merlin-conf |
> sed 's/[0-9]*:/?:/g' | sed 's/)(/)|(/g' | tr '|' '\n' | grep -E "FLG"
(?:FLG?:-open Usesppx1 -w -40 -open Usesppx2 -w -40))
(?:FLG(?:-open?:Usesppx?:-w?:-?:-open?:Usesppx?:-w?:-40)))
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/github2206.t/run.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
copy_files would break the generation of the preprocessing flags
$ dune build copy_files/.merlin-conf
$ cat _build/default/copy_files/.merlin-conf |
> sed 's/[0-9]*:/?:/g' | sed 's/)/)|/g' | tr '|' '\n' | grep -E "FLG\?:-pp"
(?:FLG?:-pp '$TESTCASE_ROOT/_build/default/pp.exe')
> sed 's/[0-9]*:/?:/g' | sed 's/)/)|/g' | tr '|' '\n' | grep -E "pp"
(?:FLG(?:-pp?:$TESTCASE_ROOT/_build/default/pp.exe)
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/github759.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
((?:EXCLUDE_QUERY_DIR)
(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(?:S?:$TESTCASE_ROOT)
(?:FLG?:-open Foo -w -40))
(?:FLG(?:-open?:Foo?:-w?:-40)))

$ rm -f .merlin
$ dune build foo.cma --profile release
Expand All @@ -13,7 +13,7 @@
((?:EXCLUDE_QUERY_DIR)
(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(?:S?:$TESTCASE_ROOT)
(?:FLG?:-open Foo -w -40))
(?:FLG(?:-open?:Foo?:-w?:-40)))

$ echo toto > .merlin
$ dune build foo.cma --profile release
Expand All @@ -22,4 +22,4 @@
((?:EXCLUDE_QUERY_DIR)
(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)
(?:S?:$TESTCASE_ROOT)
(?:FLG?:-open Foo -w -40))
(?:FLG(?:-open?:Foo?:-w?:-40)))
12 changes: 6 additions & 6 deletions test/blackbox-tests/test-cases/merlin/merlin-tests.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
(?:S?:$LIB_PREFIX/lib/ocaml)
(?:S?:$TESTCASE_ROOT/exe)
(?:S?:$LIB_PREFIX/lib)
(?:FLG?:-pp '$TESTCASE_ROOT/_build/default/pp/pp.exe')
(?:FLG?:-w -40))
(?:FLG(?:-pp?:$TESTCASE_ROOT/_build/default/pp/pp.exe))
(?:FLG(?:-w?:-40)))
# Processing lib/.merlin-conf
((?:EXCLUDE_QUERY_DIR)
(?:B?:$LIB_PREFIX/lib/bytes)
Expand All @@ -26,8 +26,8 @@
(?:S?:$LIB_PREFIX/lib/ocaml)
(?:S?:$LIB_PREFIX/lib)
(?:S?:$LIB_PREFIX/lib/subdir)
(?:FLG?:-ppx '$PPX/4128e43a9cfb141a37f547484cc9bf46/ppx.exe --as-ppx --cookie '\''library-name="foo"'\''')
(?:FLG?:-open Foo -w -40 -open Bar -w -40))
(?:FLG(?:-ppx?:$TESTCASE_ROOT/_build/default/.ppx/4128e43a9cfb141a37f547484cc9bf46/ppx.exe --as-ppx --cookie 'library-name="foo"'))
(?:FLG(?:-open?:Foo?:-w?:-?:-open?:Bar?:-w?:-40)))

Make sure a ppx directive is generated

Expand All @@ -41,8 +41,8 @@ Make sure pp flag is correct and variables are expanded
((?:EXCLUDE_QUERY_DIR)
(?:B?:$TESTCASE_ROOT/_build/default/pp-with-expand/.foobar.eobjs/byte)
(?:S?:$TESTCASE_ROOT/pp-with-expand)
(?:FLG?:-pp '$TESTCASE_ROOT/_build/default/pp/pp.exe -nothing')
(?:FLG?:-w @[email protected]@30..39@[email protected]@[email protected]40 -strict-sequence -strict-formats -short-paths -keep-locs))
(?:FLG(?:-pp?:$TESTCASE_ROOT/_build/default/pp/pp.exe -nothing))
(?:FLG(?:-w?:@1..3@5[email protected]@[email protected]@[email protected]?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))

We want future-syntax to either be applied, or not, depending on OCaml version.
Adding the `echo` with expected output to the set of lines is a way of achieving that.
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/merlin/server.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
$ dune ocaml-merlin <<EOF | sed -E "s/[[:digit:]]+:/\?:/g"
> (4:File${#FILE}:$FILE)
> EOF
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.main.eobjs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.objs/byte)(?:S?:$TESTCASE_ROOT)(?:FLG?:-open Mylib -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs))
((?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.main.eobjs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.mylib.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?:-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 @@ -22,4 +22,4 @@ library also has more than one src dir.
(?:S?:$TESTCASE_ROOT/lib1)
(?:S?:$TESTCASE_ROOT/lib1/sub)
(?:S?:$TESTCASE_ROOT/lib2)
(?:FLG?:-open Lib2 -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs))
(?:FLG(?:-open?:Lib?:-w?:@1..3@5..28@30..39@43@46..47@49..57@61..62-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs)))

0 comments on commit 1c4533c

Please sign in to comment.