Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/blackbox-tests/test-cases/describe_location.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ An executable from the current project:
_build/default/foo.exe

Test that executables from dependencies are located correctly:
$ mkdir dune.lock
$ cat > dune.lock/lock.dune << EOF

$ default_lock_dir="dune.lock"
$ mkdir -p "${default_lock_dir}"
$ cat > "${default_lock_dir}"/lock.dune <<EOF
> (lang package 0.1)
> EOF
$ cat > dune.lock/bar.pkg << EOF
$ cat > ${default_lock_dir}/bar.pkg << EOF
> (version 0.1)
> (install
> (progn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Test that section pforms are substituted with absolute paths.

$ make_lockdir

$ cat >dune.lock/test.pkg <<EOF
$ cat > ${default_lock_dir}/test.pkg <<EOF
> (version 0.0.1)
> (install (progn
> (run echo --prefix %{prefix})
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/alias-pkg-install.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Ensure the alias is not available outside of the package manamgent context:

Create a fake package which echoes information to stdout when build:
$ make_lockdir
$ cat > dune.lock/foo.pkg << EOF
$ cat > ${default_lock_dir}/foo.pkg << EOF
> (version 0.0.1)
> (build
> (run echo "Build package foo"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ Make a directory to contain a test project and change to it.
$ cd project

Create a lockdir for the project.
$ mkdir dune.lock
$ cat > dune.lock/lock.dune <<EOF
> (lang package 0.1)
> EOF
$ make_lockdir

The package "foo" exercises copying package sources from a local directory.
$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 0.0.1)
> (source
> (fetch
Expand All @@ -34,7 +31,7 @@ The package "foo" exercises copying package sources from a local directory.
> EOF

The package "bar" exercises extracting a source archive from a local file.
$ cat > dune.lock/bar.pkg <<EOF
$ cat > ${default_lock_dir}/bar.pkg <<EOF
> (version 0.0.1)
> (source
> (fetch
Expand All @@ -43,7 +40,7 @@ The package "bar" exercises extracting a source archive from a local file.
> EOF

The package "bar" exercises extracting a source archive from a downloaded file.
$ cat > dune.lock/baz.pkg <<EOF
$ cat > ${default_lock_dir}/baz.pkg <<EOF
> (version 0.0.1)
> (source
> (fetch
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/pkg/check-dependency-hash.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Start with a project with a single package with no dependencies:
> EOF
Solution for dune.lock:
(no dependencies to lock)
$ cat dune.lock/lock.dune
$ cat ${default_lock_dir}/lock.dune
(lang package 0.1)

(repositories
Expand Down Expand Up @@ -49,7 +49,7 @@ Add a non-local dependency to the package:
> EOF
Solution for dune.lock:
- a.0.0.1
$ cat dune.lock/lock.dune
$ cat ${default_lock_dir}/lock.dune
(lang package 0.1)

(dependency_hash 7ba1cacd46bb2609d7b9735909c3b8a5)
Expand Down Expand Up @@ -98,7 +98,7 @@ Remove all dependencies from the project:

Exercise handling invalid dependency hashes.
$ make_lock_metadata_with_hash() {
> cat >dune.lock/lock.dune <<EOF
> cat > ${default_lock_dir}/lock.dune <<EOF
> (lang package 0.1)
> (dependency_hash $1)
> (repositories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Create a directory containing a shell script and add the directory to PATH.

Create a lockdir with a lockfile that runs the shell script in a build command.
$ make_lockdir
$ cat >dune.lock/test.pkg <<'EOF'
$ cat > ${default_lock_dir}/test.pkg <<'EOF'
> (version 0.0.1)
> (build (run hello))
> EOF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A file that will comprise the package source:

Replace the path in the lockfile as it would otherwise include the sandbox
path.
$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(source
Expand Down Expand Up @@ -54,7 +54,7 @@ Recreate the foo package with a fake port number to signal that the file will
Warning: download failed with code 404
Solution for dune.lock:
- foo.0.0.1
$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ constraints.
- a.0.0.1
- foo.0.0.1

$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(depends a)
16 changes: 8 additions & 8 deletions test/blackbox-tests/test-cases/pkg/convert-opam-commands.t
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Package which has boolean where string was expected. This should be caught while
- with-interpolation.0.0.1
- with-percent-sign.0.0.1

$ cat dune.lock/standard-dune.pkg
$ cat ${default_lock_dir}/standard-dune.pkg
(version 0.0.1)

(install
Expand All @@ -105,7 +105,7 @@ Package which has boolean where string was expected. This should be caught while
(run dune subst))
(run dune build -p %{pkg-self:name} -j %{jobs} @install)))

$ cat dune.lock/with-interpolation.pkg
$ cat ${default_lock_dir}/with-interpolation.pkg
(version 0.0.1)

(install
Expand All @@ -116,13 +116,13 @@ Package which has boolean where string was expected. This should be caught while
(run ./configure --prefix=%{prefix} --docdir=%{doc}/ocaml)
(run %{make} -j%{jobs})))

$ cat dune.lock/with-percent-sign.pkg
$ cat ${default_lock_dir}/with-percent-sign.pkg
(version 0.0.1)

(build
(run printf %d 42))

$ cat dune.lock/variable-types.pkg
$ cat ${default_lock_dir}/variable-types.pkg
(version 0.0.1)

(build
Expand All @@ -144,7 +144,7 @@ Package which has boolean where string was expected. This should be caught while
Solution for dune.lock:
- exercise-filters.0.0.1

$ cat dune.lock/exercise-filters.pkg
$ cat ${default_lock_dir}/exercise-filters.pkg
(version 0.0.1)

(build
Expand Down Expand Up @@ -193,7 +193,7 @@ Test that if opam filter translation is disabled the output doesn't contain any
$ solve exercise-filters
Solution for dune.lock:
- exercise-filters.0.0.1
$ cat dune.lock/exercise-filters.pkg
$ cat ${default_lock_dir}/exercise-filters.pkg
(version 0.0.1)

(build
Expand Down Expand Up @@ -241,7 +241,7 @@ Test that if opam filter translation is disabled the output doesn't contain any
$ solve exercise-term-filters
Solution for dune.lock:
- exercise-term-filters.0.0.1
$ cat dune.lock/exercise-term-filters.pkg
$ cat ${default_lock_dir}/exercise-term-filters.pkg
(version 0.0.1)

(build
Expand Down Expand Up @@ -301,7 +301,7 @@ to a dune if-statement that checks the "enable" variable (rather than the
It's probably an error for opam packages to use the "enable" in ways that opam
doesn't desugar but these tests are included so we can check that behaviour is
preserved between opam and dune.
$ cat dune.lock/package-conjunction-and-string-selection.pkg
$ cat ${default_lock_dir}/package-conjunction-and-string-selection.pkg
(version 0.0.1)

(build
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/default-exported-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Some environment variables are automatically exported by packages:
$ . ./helpers.sh

$ make_lockdir
$ echo "(version 0.0.1)" > dune.lock/test.pkg
$ cat >dune.lock/usetest.pkg <<'EOF'
$ echo "(version 0.0.1)" > ${default_lock_dir}/test.pkg
$ cat > ${default_lock_dir}/usetest.pkg <<'EOF'
> (version 0.0.1)
> (depends test)
> (build
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/depexts/error-message.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Make a project that uses the foo library:

Make dune.lock files with known program "dune".
$ make_lockdir
$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 0.0.1)
> (build
> (run dune build))
Expand Down Expand Up @@ -54,7 +54,7 @@ error message.

Make dune.lock files with unknown program and unknown package.
$ make_lockdir
$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 0.0.1)
> (build
> (run unknown-program))
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/depexts/print-depexts.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Make a project:
Create a lockdir with a package that features some depexts.

$ make_lockdir
$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 0.0.1)
> (depexts unzip gnupg)
> EOF
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/depexts/solve.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ locking would add the opam 'depext' field to foo.pkg
$ dune pkg lock
Solution for dune.lock:
- foo.0.0.1
$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(depexts unzip gnupg)
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Locking should succeed and not include the "unzip" package
$ dune pkg lock 2>&1 | head -n 1
Solution for dune.lock:

$ [ -e dune.lock/foo.pkg ] && cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The optional dependency on "b" is not included in foo's dependencies because
Solution for dune.lock:
- a.0.0.1
- foo.0.0.1
$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(depends a)
Expand All @@ -37,7 +37,7 @@ the dependencies of "foo", since "b" is part of the package solution:
- b.0.0.1
- bar.0.0.1
- foo.0.0.1
$ cat dune.lock/foo.pkg
$ cat ${default_lock_dir}/foo.pkg
(version 0.0.1)

(depends a b)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Make a package with a depopts field
When depopts are supported and selected, the above lock should change and we
should also be able to see a deps field in the lock file:

$ cat dune.lock/with-depopts.pkg
$ cat ${default_lock_dir}/with-depopts.pkg
(version 0.0.1)

We should also be able to validate the lock directory:
Expand Down
7 changes: 2 additions & 5 deletions test/blackbox-tests/test-cases/pkg/duplicate-packages.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ shouldn't be allowed (for now)
$ cat > mypkg.opam <<EOF
> opam-version: "2.0"
> EOF
$ mkdir dune.lock
$ cat >dune.lock/lock.dune <<EOF
> (lang package 0.1)
> EOF
$ touch dune.lock/mypkg.lock
$ make_lockdir
$ touch ${default_lock_dir}/mypkg.lock

$ dune build

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Test for packages with no source field but with extra_sources.
$ . ./helpers.sh
$ make_lockdir

$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 1)
> (extra_sources
> (foo.txt
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/exported-env.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Packages can export environment variables
$ . ./helpers.sh

$ make_lockdir
$ cat >dune.lock/test.pkg <<EOF
$ cat > ${default_lock_dir}/test.pkg <<EOF
> (version 0.0.1)
> (exported_env
> (= FOO bar)
Expand All @@ -12,7 +12,7 @@ Packages can export environment variables
> (:= BAR zzz))
> EOF

$ cat >dune.lock/usetest.pkg <<'EOF'
$ cat > ${default_lock_dir}/usetest.pkg <<'EOF'
> (depends test)
> (version 1.2.3)
> (build
Expand Down
6 changes: 4 additions & 2 deletions test/blackbox-tests/test-cases/pkg/external-lock-dir.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ A lock directory which does not exist in the source tree:

$ . ./helpers.sh

$ mkdir dune.lock project
$ cat >dune.lock/foo.pkg <<EOF
$ mkdir project

$ make_lockdir
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (build (run echo foo))
> (version 1.0.0)
> EOF
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/external-source.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Test that can fetch the sources from an external dir
$ echo "y" > foo/x

$ make_lockdir
$ cat >dune.lock/test.pkg <<EOF
$ cat > ${default_lock_dir}/test.pkg <<EOF
> (version 0.0.1)
> (source (copy $PWD/foo))
> (build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ file in the package's source.
$ . ./helpers.sh
$ make_lockdir

$ cat > dune.lock/foo.pkg <<EOF
$ cat > ${default_lock_dir}/foo.pkg <<EOF
> (version 1)
> (source
> (copy $PWD/foo-source))
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/extra-sources.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Fetch from more than one source
> this is baz
> EOF

$ cat >dune.lock/test.pkg <<EOF
$ cat > ${default_lock_dir}/test.pkg <<EOF
> (version 0.0.1)
> (source (copy $PWD/foo))
> (extra_sources (mybaz (copy $PWD/baz)))
Expand Down Expand Up @@ -114,7 +114,7 @@ url and the extra source.
Solution for dune.lock:
- needs-patch.0.0.1

$ sed -E 's/md5=[0-9a-f]+/md5=$HASH/g' dune.lock/needs-patch.pkg
$ sed -E 's/md5=[0-9a-f]+/md5=$HASH/g' ${default_lock_dir}/needs-patch.pkg
(version 0.0.1)

(build
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/fetch-cache.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Set up a project that depends on a package that is being downloaded
$ echo test.tar > fake-curls
$ SRC_PORT=1
$ SRC_CHECKSUM=$(md5sum test.tar | cut -f1 -d' ')
$ cat >dune.lock/test.pkg <<EOF
$ cat > ${default_lock_dir}/test.pkg <<EOF
> (version 0.0.1)
> (source
> (fetch
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/file-depends.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the files found in files-depend.
$ make_lockdir

$ foo=$PWD/foo
> cat > dune.lock/file-depends.pkg <<EOF
> cat > ${default_lock_dir}/file-depends.pkg <<EOF
> (version 0.0.1)
> (build
> (system "\| echo Building file-depends
Expand All @@ -24,7 +24,7 @@ checksum is not parsable.

Now we make a package depending on file-depends.

$ cat > dune.lock/dep.pkg <<EOF
$ cat > ${default_lock_dir}/dep.pkg <<EOF
> (version 0.0.1)
> (depends file-depends)
> (build
Expand Down
Loading
Loading