Skip to content

Commit

Permalink
Refactor the test case into a single file
Browse files Browse the repository at this point in the history
The only real change between this file and pkg/libraries.t is the build command.

Signed-off-by: Andrew Patterson <[email protected]>
  • Loading branch information
liate7 committed Oct 3, 2024
1 parent c739573 commit 6524b7b
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 36 deletions.
55 changes: 55 additions & 0 deletions test/blackbox-tests/test-cases/ocaml-index/gh10985.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
This test attempts to build the ocaml index while depending on a library
installed through a lock file.

We set up a library that will be installed as part of the package:

$ mkdir external_sources
$ cat >external_sources/dune-project <<EOF
> (lang dune 3.11)
> (package (name mypkg))
> EOF
$ cat >external_sources/dune <<EOF
> (library
> (public_name mypkg.lib)
> (name test_lib))
> EOF
$ cat >external_sources/test_lib.ml <<EOF
> let x = ()
> EOF

Now we set up a lock file with this package and then attempt to use it:

$ cat >dune-project <<EOF
> (lang dune 3.11)
> EOF

$ mkdir dune.lock
$ cat >dune.lock/lock.dune <<EOF
> (lang package 0.1)
> EOF

$ cat >dune.lock/mypkg.pkg <<EOF
> (version 0.0.1)
> (source (copy $PWD/external_sources))
> (build (run dune build --release --promote-install-file=true . @install))
> EOF

$ cat >dune <<EOF
> (dirs (:standard \ external_sources))
> (library
> (name foo)
> (libraries mypkg.lib))
> EOF

$ cat >foo.ml <<EOF
> let () = Test_lib.x
> EOF

$ dune build @ocaml-index
Error: This rule defines a directory target "default/.pkg/mypkg/target" that
matches the requested path
"default/.pkg/mypkg/target/lib/mypkg/lib/cctx.ocaml-index" but the rule's
action didn't produce it
-> required by _build/default/.foo.objs/cctx.ocaml-index
-> required by alias ocaml-index
[1]
4 changes: 0 additions & 4 deletions test/blackbox-tests/test-cases/ocaml-index/gh10985/dune

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test/blackbox-tests/test-cases/ocaml-index/gh10985/foo.ml

This file was deleted.

23 changes: 0 additions & 23 deletions test/blackbox-tests/test-cases/ocaml-index/gh10985/run.t

This file was deleted.

0 comments on commit 6524b7b

Please sign in to comment.