Skip to content

Commit

Permalink
tests: promote expected changes
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed May 7, 2024
1 parent 0e0dd27 commit 6da9b18
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 29 deletions.
9 changes: 9 additions & 0 deletions test/blackbox-tests/test-cases/describe/aliases.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ In an empty dune project, the following aliases are available.
all
default
fmt
ocaml-index

User defined aliases can be added to a dune file. These should be picked up by
the command.
Expand All @@ -22,6 +23,7 @@ the command.
default
fmt
foo
ocaml-index

Aliases in subdirectories should not be picked up.

Expand All @@ -36,6 +38,7 @@ Aliases in subdirectories should not be picked up.
default
fmt
foo
ocaml-index

But checking the subdirectory it should be available.

Expand All @@ -58,6 +61,7 @@ Adding an OCaml library will introduce OCaml specific aliases:
default
doc-private
fmt
ocaml-index

Adding a cram test will introduce an alias with the name of the test and also
introduce the runtest alias:
Expand All @@ -70,6 +74,7 @@ bbb
default
fmt
mytest
ocaml-index
runtest

We can also show aliases in multiple directories at once:
Expand All @@ -80,6 +85,7 @@ We can also show aliases in multiple directories at once:
default
fmt
mytest
ocaml-index
runtest

subdir:
Expand All @@ -97,13 +103,15 @@ Including those in the _build/ directory:
default
fmt
mytest
ocaml-index
runtest

_build/default:
all
default
fmt
mytest
ocaml-index
runtest

These are context sensitive:
Expand All @@ -123,4 +131,5 @@ These are context sensitive:
default
fmt
mytest
ocaml-index
runtest
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/describe/targets.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ working directory.
d/
dune
dune-project
project.ocaml-index
simple.a
simple.cma
simple.cmxa
Expand All @@ -27,6 +28,7 @@ used, and only the targets available in that directory will be displayed.
d/
dune
dune-project
project.ocaml-index
simple.a
simple.cma
simple.cmxa
Expand All @@ -49,6 +51,7 @@ The command also works with files in the _build directory.
d/
dune
dune-project
project.ocaml-index
simple.a
simple.cma
simple.cmxa
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/dialects/dots.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ Test the (dialect ...) stanza inside the `dune-project` file.
$ dune build --display short 2>&1 | grep -i cppo
ocamlc .cppo.eobjs/byte/dune__exe__Cppo.{cmi,cmti}
ocamlopt .cppo.eobjs/native/dune__exe__Cppo.{cmx,o}
ocamlc .cppo.eobjs/byte/dune__exe__Cppo.{cmo,cmt}
ocamlopt cppo.exe
cppo main.cppo.ml.ml
File ".cppo.eobjs/_unknown_", line 1, characters 0-0:
ocaml-index .cppo.eobjs/cctx.ocaml-index (exit 125)

$ dune build @show
print_endline "Hello, World"
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ Or their parent interface modules:
of the library. Consequently, it should be the one depending on all the other
modules in the library.
-> required by _build/default/.foo.objs/foo__Baz__Foo__Z.impl.all-deps
-> required by _build/default/.foo.objs/byte/foo__Baz__Foo__Z.cmo
-> required by _build/default/foo.cma
-> required by _build/default/.foo.objs/byte/foo__Baz__Foo__Z.cmt
-> required by _build/default/.foo.objs/cctx.ocaml-index
-> required by _build/default/project.ocaml-index
-> required by alias all
-> required by alias default
[1]
28 changes: 20 additions & 8 deletions test/blackbox-tests/test-cases/melange/merlin.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
(FLG (-open Foo__))
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
(FLG (-open Foo__))
(FLG (-open Foo__)
(UNIT_NAME foo__Bar))
Foo: _build/default/foo
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
(FLG (-open Foo__))
Foo: _build/default/foo.ml
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
(FLG (-open Foo__))
(FLG (-open Foo__)
(UNIT_NAME foo))
Foo__: _build/default/foo__
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
Foo__: _build/default/foo__.ml-gen
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
(UNIT_NAME foo__))

Paths to Melange stdlib appear in B and S entries without melange.emit stanza

Expand Down Expand Up @@ -111,7 +114,9 @@ User ppx flags should appear in merlin config

$ dune ocaml merlin dump-config $PWD | grep -v "(B " | grep -v "(S "
Bar: _build/default/bar
((STDLIB /MELC_STDLIB/melange)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /MELC_STDLIB/melange)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
Expand Down Expand Up @@ -153,9 +158,12 @@ User ppx flags should appear in merlin config
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Bar))
Foo: _build/default/foo
((STDLIB /MELC_STDLIB/melange)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /MELC_STDLIB/melange)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/melange)
Expand Down Expand Up @@ -195,9 +203,12 @@ User ppx flags should appear in merlin config
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo))
Fooppx: _build/default/fooppx
((STDLIB /OCAMLC_WHERE)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OCAMLC_WHERE)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.fooppx.objs/byte)
Expand Down Expand Up @@ -225,4 +236,5 @@ User ppx flags should appear in merlin config
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME fooppx))
49 changes: 35 additions & 14 deletions test/blackbox-tests/test-cases/merlin/include-subdirs-qualified.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
$ dune build .merlin-conf/lib-foo
$ dune ocaml merlin dump-config .
Foo: _build/default/foo
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -58,9 +60,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo))
Foo__Groupintf__: _build/default/foo__Groupintf__
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -96,9 +101,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Groupintf__))
Utils: _build/default/foo__Utils
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -134,9 +142,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Utils))
Calc: _build/default/groupintf/calc
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -174,9 +185,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Groupintf__Calc))
Groupintf: _build/default/groupintf/groupintf
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -214,9 +228,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Groupintf))
Main: _build/default/main
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -254,9 +271,12 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Main))
Calc: _build/default/utils/calc
((STDLIB /OPAM_PREFIX)
((INDEX_FILE
$TESTCASE_ROOT/_build/default/project.ocaml-index)
(STDLIB /OPAM_PREFIX)
(EXCLUDE_QUERY_DIR)
(B
$TESTCASE_ROOT/_build/default/.foo.objs/byte)
Expand Down Expand Up @@ -294,5 +314,6 @@
-strict-formats
-short-paths
-keep-locs
-g)))
-g))
(UNIT_NAME foo__Utils__Calc))
$ dune ocaml merlin dump-config utils
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/ocamldep-error-check.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Dune uses ocamldep to prevent a module from depending on itself.
$ cat >lib/bar.ml <<EOF
> Foo.bar
> EOF
$ dune build @all
$ dune build @lib/all
Error: Module Bar in directory _build/default/lib depends on Foo.
This doesn't make sense to me.

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/trace-file.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This captures the commands that are being run:
{"args":{"dir":"."},"ph":"X","dur":...,"name":"Source tree scan","cat":"","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-config"],"pid":...},"ph":"X","dur":...,"name":"ocamlc.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-modules","-impl","prog.ml"],"pid":...},"ph":"X","dur":...,"name":"ocamldep.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g","-bin-annot","-I",".prog.eobjs/byte","-no-alias-deps","-opaque","-o",".prog.eobjs/byte/prog.cmo","-c","-impl","prog.ml"],"pid":...},"ph":"X","dur":...,"name":"ocamlc.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g","-bin-annot","-bin-annot-occurrences","-I",".prog.eobjs/byte","-no-alias-deps","-opaque","-o",".prog.eobjs/byte/prog.cmo","-c","-impl","prog.ml"],"pid":...},"ph":"X","dur":...,"name":"ocamlc.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g","-I",".prog.eobjs/byte","-I",".prog.eobjs/native","-intf-suffix",".ml","-no-alias-deps","-opaque","-o",".prog.eobjs/native/prog.cmx","-c","-impl","prog.ml"],"pid":...},"ph":"X","dur":...,"name":"ocamlopt.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"process_args":["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g","-o","prog.exe",".prog.eobjs/native/prog.cmx"],"pid":...},"ph":"X","dur":...,"name":"ocamlopt.opt","cat":"process","ts":...,"pid":...,"tid":...}
{"args":{"path":"_build/.db","module":"INCREMENTAL-DB"},"ph":"X","dur":...,"name":"Writing Persistent Dune State","cat":"","ts":...,"pid":...,"tid":...}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ appropriate error message.
3 | (implements lib))
^^^
Error: Library "lib" is not virtual. It cannot be implemented by "impl".
-> required by _build/default/project.ocaml-index
-> required by alias all
-> required by alias default in dune:1
[1]
3 changes: 0 additions & 3 deletions test/expect-tests/dune_config_file/dune_config_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let%expect_test "cache-check-probability 0.1" =
{ display = Simple { verbosity = Quiet; status_line = false }
; concurrency = Fixed 1
; terminal_persistence = Clear_on_rebuild
; workspace_indexation = Disabled
; sandboxing_preference = []
; cache_enabled = Disabled
; cache_reproducibility_check = Check_with_probability 0.1
Expand All @@ -40,7 +39,6 @@ let%expect_test "cache-storage-mode copy" =
{ display = Simple { verbosity = Quiet; status_line = false }
; concurrency = Fixed 1
; terminal_persistence = Clear_on_rebuild
; workspace_indexation = Disabled
; sandboxing_preference = []
; cache_enabled = Disabled
; cache_reproducibility_check = Skip
Expand All @@ -59,7 +57,6 @@ let%expect_test "cache-storage-mode hardlink" =
{ display = Simple { verbosity = Quiet; status_line = false }
; concurrency = Fixed 1
; terminal_persistence = Clear_on_rebuild
; workspace_indexation = Disabled
; sandboxing_preference = []
; cache_enabled = Disabled
; cache_reproducibility_check = Skip
Expand Down

0 comments on commit 6da9b18

Please sign in to comment.