Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
  • Loading branch information
nojb committed Oct 16, 2019
1 parent 937884e commit cb1f1c3
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion test/blackbox-tests/test-cases/deprecated-library-name/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ First the motivating case.
> EOF

$ cd d && dune build --root . @install

$ find d/_build/install/default -name 'META' | sort
d/_build/install/default/lib/dummy/META
d/_build/install/default/lib/menhir/META
d/_build/install/default/lib/menhirLib/META
d/_build/install/default/lib/menhirSdk/META

$ cat d/_build/install/default/lib/dummy/META


Expand All @@ -139,21 +141,23 @@ First the motivating case.
$ cat d/_build/install/default/lib/menhirSdk/META
requires = "menhir.sdk"


$ find d/_build/install/default -name 'dune-package' | sort
d/_build/install/default/lib/dummy/dune-package
d/_build/install/default/lib/menhir/dune-package
d/_build/install/default/lib/menhirLib/dune-package
d/_build/install/default/lib/menhirSdk/dune-package

$ cat d/_build/install/default/lib/dummy/dune-package
(lang dune 2.0)
(name dummy)

$ cat d/_build/install/default/lib/menhirLib/dune-package
(lang dune 2.0)
(name menhirLib)
(deprecated_library_name
(old_public_name menhirLib)
(new_public_name menhir.lib))

$ cat d/_build/install/default/lib/menhirSdk/dune-package
(lang dune 2.0)
(name menhirSdk)
Expand Down Expand Up @@ -195,6 +199,7 @@ Checks that we can migrate top-level libraries across packages.
> EOF

$ cd d && dune build --root . @install

$ cat d/_build/install/default/lib/top1/META
requires = "q.bar"

Expand All @@ -213,6 +218,7 @@ old public name:
> EOF

$ cd d && dune build --root . @all

$ cat d/_build/install/default/lib/top2/META
requires = "q.top2"

Expand Down Expand Up @@ -284,16 +290,20 @@ Qualified, deprecated old_public_name:
> EOF
$ cd d && dune build --root . @all

$ find d/_build/install/default -name 'META' | sort
d/_build/install/default/lib/p/META
d/_build/install/default/lib/q/META

$ cat d/_build/install/default/lib/q/META
package "foo" (
requires = "p"
)

$ find d/_build/install/default -name 'dune-package' | sort
d/_build/install/default/lib/p/dune-package
d/_build/install/default/lib/q/dune-package

$ cat d/_build/install/default/lib/q/dune-package
(lang dune 2.0)
(name q)
Expand Down Expand Up @@ -321,21 +331,65 @@ Two libraries redirecting to the same library:
> EOF

$ cd d && dune build --root . @all

$ find d/_build/install/default -name 'META' | sort
d/_build/install/default/lib/p/META
d/_build/install/default/lib/q/META

$ cat d/_build/install/default/lib/q/META
package "bar" (
requires = "p"
)
package "foo" (
requires = "p"
)

$ find d/_build/install/default -name 'dune-package' | sort
d/_build/install/default/lib/p/dune-package
d/_build/install/default/lib/q/dune-package

$ cat d/_build/install/default/lib/q/dune-package
(lang dune 2.0)
(name q)
(deprecated_library_name (old_public_name q.bar) (new_public_name p))
(deprecated_library_name (old_public_name q.foo) (new_public_name p))

Check that we can use deprecated packages from within the same project and
across projects.

$ mkdir -p d/p/a d/p/b

$ cat >d/p/a/dune-project <<EOF
> (lang dune 2.0)
> (package (name a) (deprecated_package_names aa))
> EOF

$ cat >d/p/b/dune-project <<EOF
> (lang dune 2.0)
> (package (name b))
> EOF

$ cat >d/p/a/dune <<EOF
> (rule (with-stdout-to empty1.ml (progn)))
> (rule (with-stdout-to empty2.ml (progn)))
> (deprecated_library_name
> (old_public_name aa.foo)
> (new_public_name a.p))
> (library
> (name p)
> (public_name a.p)
> (modules empty1))
> (library
> (name q)
> (libraries aa.foo)
> (modules empty2))
> EOF

$ cat >d/p/b/dune <<EOF
> (rule (with-stdout-to empty.ml (progn)))
> (library
> (name b)
> (libraries aa.foo))
> EOF

$ cd d/p && dune build --root . @all

0 comments on commit cb1f1c3

Please sign in to comment.