Skip to content

Commit

Permalink
Fix the tests after the addition of the empty package detection feature
Browse files Browse the repository at this point in the history
Signed-off-by: Kate <kit.ty.kate@disroot.org>
  • Loading branch information
kit-ty-kate committed Aug 22, 2021
1 parent a4fa0f6 commit 93f0bee
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions otherlibs/build-info/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Test embedding of build information
> EOF
$ dune build
Warning: The package d is empty.
$ dune install --prefix _install 2> /dev/null
Inside _build, we have no version information:
Expand Down
1 change: 1 addition & 0 deletions otherlibs/site/test/bug_4219.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Test when sites name which are ocaml keyword
> EOF
$ dune build
Warning: The package my-package is empty.
5 changes: 4 additions & 1 deletion otherlibs/site/test/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,15 @@ Test %{version:installed-pkg}
$ OCAMLPATH=_install/lib:$OCAMLPATH dune build --root=f
Entering directory 'f'
Warning: The package f is empty.
$ cat $(pwd)/f/_build/default/test.target
a = 0.a
e =
$ cat f/dune | sed 's/version:a/version:a.test/' > f/dune.tmp && mv f/dune.tmp f/dune
$ OCAMLPATH=_install/lib:$OCAMLPATH dune build --root=f
Entering directory 'f'
Warning: The package f is empty.
File "dune", line 6, characters 15-32:
6 | (echo "a = %{version:a.test}\n")
^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -437,7 +439,8 @@ Test error location
> (generate_sites_module (module sites) (sites non-existent))
> EOF
$ dune build
$ dune build -j1
Warning: The package f is empty.
File "a/dune", line 4, characters 45-57:
4 | (generate_sites_module (module sites) (sites non-existent))
^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/bin-eager-deps.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ when the rule needs to be used to build a target.
> (action (echo "test")))
> EOF
$ dune build @install
Warning: The package randompackage is empty.
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/custom-build-dir.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ Test with a build directory that doesn't start with _
$ touch pkg.opam
$ dune build --build-dir build pkg.opam
$ dune build --build-dir build
Warning: The package pkg is empty.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ tests that the "old_public_name" field is evaluated lazily
$ (cd a
> dune build @install --root .
> dune install --prefix $PWD/../_install)
Warning: The package a is empty.
Installing $TESTCASE_ROOT/a/../_install/lib/a/META
Installing $TESTCASE_ROOT/a/../_install/lib/a/dune-package
Expand Down Expand Up @@ -396,3 +397,4 @@ across projects.
> EOF
$ (cd d/p && dune build --root . @all)
Warning: The package b is empty.
16 changes: 15 additions & 1 deletion test/blackbox-tests/test-cases/dune-init.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,24 @@ Can add multiple libraries in the same directory
(library
(name test_lib2)
(libraries test_lib1))
$ cat ./_test_lib/dune-project
cat: ./_test_lib/dune-project: No such file or directory
[1]
Can build the multiple library project
Can build the multiple library project but fails because empty
$ echo '(lang dune 3.0)' > ./_test_lib/dune-project
$ (cd _test_lib && touch test_lib1.opam && dune build)
Error: The package test_lib1 is empty.
-> required by _build/default/test_lib1.install
-> required by alias all
-> required by alias default
[1]
Can build the multiple library project
$ echo '(package (name test_lib1) (may_be_empty))' >> ./_test_lib/dune-project
$ (cd _test_lib && dune build)
Clan up the multiple library project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Reproduction case for #2927
> EOF
$ dune build
Warning: The package foo is empty.
$ cat foo.opam
# This file is generated by dune, edit dune-project instead
Expand Down
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/dune-project-meta/main.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The `dune build` should generate the opam file
$ dune build @install --root test1
Entering directory 'test1'
Warning: The package cohttp is empty.
Warning: The package cohttp-async is empty.
$ cat test1/cohttp.opam
# This file is generated by dune, edit dune-project instead
Expand Down Expand Up @@ -131,6 +133,7 @@ Package information fields can be overridden per-package:
$ dune build @install --root test2
Entering directory 'test2'
Warning: The package foo is empty.
$ cat test2/foo.opam
# This file is generated by dune, edit dune-project instead
Expand Down Expand Up @@ -245,6 +248,7 @@ Generation of opam files with lang dune >= 1.11
$ dune build @install --root gen-v1.11
Entering directory 'gen-v1.11'
Warning: The package test is empty.
$ cat gen-v1.11/test.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
Expand Down Expand Up @@ -287,6 +291,7 @@ sorted in a way that pleases "opam lint".
> EOF
$ dune build @install --root template
Entering directory 'template'
Warning: The package foo is empty.
$ tail -n 1 template/foo.opam
x-foo: "blah"
Expand All @@ -295,6 +300,7 @@ sorted in a way that pleases "opam lint".
> EOF
$ dune build @install --root template
Entering directory 'template'
Warning: The package foo is empty.
$ tail -n 1 template/foo.opam
libraries: [ "blah" ]
Expand All @@ -303,6 +309,7 @@ sorted in a way that pleases "opam lint".
> EOF
$ dune build @install --root template
Entering directory 'template'
Warning: The package foo is empty.
$ tail -n 1 template/foo.opam
depends: [ "overridden" ]
Expand Down Expand Up @@ -344,6 +351,7 @@ Supported since 2.1:
$ dune build @install --root binops
Entering directory 'binops'
Warning: The package foo is empty.
$ grep conf-libX11 binops/foo.opam
"conf-libX11" {os != "win32"}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Dune doesn't need opam anymore
$ dune build @install
Warning: The package bar is empty.
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/enabled_if-exec.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This one is enabled
Installing should silently ignore disabled executables
$ dune build @install
Warning: The package eif is empty.
Tests for enabled_if in install stanza. Only bar.x should be installed.
$ dune build @install --root install
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github24.t/run.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
This test makes sure that @install doesn't build anything.
$ dune build @install --display short --debug-dependency-path
Warning: The package x is empty.
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/github992.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This used to fail because dune couldn't associate a compilation
context to the menhir files when package bar was hidden.
$ (cd menhir-and-dash-p && dune build -p foo)
Warning: The package foo is empty.
package field without public_name field
---------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Dune does not fail if the `packages` are not available at evaluation time
(regression test fixed by ocaml/dune#3650)

$ dune build -p unrelated-package
Warning: The package unrelated-package is empty.

Dune fails if the `packages` are not avaliable at execution time

Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/misc.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ Allowed combinations
--------------------
$ dune build --release --only-packages toto
Warning: The package toto is empty.
$ dune build --release --only-packages toto --profile foo
Warning: The package toto is empty.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Odig files should be detected relative to the package directory
$ dune build @install --root .
Warning: The package foobar is empty.
$ dune_cmd cat _build/default/project/foobar.install
lib: [
"_build/install/default/lib/foobar/META"
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/optional-executable.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Test optional executable
$ touch x.ml
$ dune build @install
Warning: The package x is empty.
$ dune build @all
Warning: The package x is empty.
File "dune", line 3, characters 12-26:
3 | (libraries does-not-exist)
^^^^^^^^^^^^^^
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/optional.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ Regression test for non-wrapped optional libraries with missing
dependencies (#1281):
$ dune build @install
Warning: The package foo is empty.
Interaction between `@all` and optional libraries:
$ dune build @all
Warning: The package foo is empty.
Reproduction case for a bug in dune < 2.4 where all libraries where
considered as optional:
Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/private-package-lib.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ First, we define a private library:
> (package foo))
> EOF
$ dune build @all
Warning: The package bar is empty.
A public library may build against it:
Expand All @@ -35,6 +36,7 @@ A public library may build against it:
> let foo = "from library foo " ^ Secret.secret
> EOF
$ dune build @install
Warning: The package bar is empty.
The naming convention puts the artifacts of private libs under __private__:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ However, public binaries may accept private dependencies
Private dependencies shouldn't make the library optional
$ dune build @install --display short --root optional
Entering directory 'optional'
Warning: The package publiclib is empty.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ doesn't verify that this is the case
$ git tag -a 1.0 -m 1.0
$ dune build @all
Warning: The package baz is empty.
Warning: The package foo is empty.
$ dune subst
File "dune-project", line 2, characters 6-9:
Expand Down

0 comments on commit 93f0bee

Please sign in to comment.