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
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/build-package-logs.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Create a package with a failing command that throws an error:

Building the package should fail and print an error:

$ build_pkg x 2>&1 | sed -E 's#/.*/cat#cat#g'
$ build_pkg x 2>&1 | dune_cmd subst '/.*/cat' cat
File "dune.lock/x.pkg", line 4, characters 11-14:
4 | (run cat i_dont_exist)))
^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Depend on foo from the repo

Which foo will we get?

$ dune pkg lock 2>&1 | grep "not found" | sed "s/$AMBIGUOUS_REF/\$AMBIGUOUS_REF/g"
$ dune pkg lock 2>&1 | grep "not found" | dune_cmd subst "$AMBIGUOUS_REF" '$AMBIGUOUS_REF'
revision "$AMBIGUOUS_REF" not found in
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/conflicts.t
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Even though the conflicts are listed by opam without a `|` to indicate a
disjunction, either package is problematic:

$ mkpkg dune 3.11
$ echo '(lang dune 3.11)' | solve_project 2>&1 | sed -E 's/3.[0-9]+/3.XX/'
$ echo '(lang dune 3.11)' | solve_project 2>&1 | dune_cmd subst '3.[0-9]+' '3.XX'
Error:
Unable to solve dependencies while generating lock directory: dune.lock

Expand All @@ -87,7 +87,7 @@ disjunction, either package is problematic:
Adding a new version of `foo` only resolves one conflict:

$ mkpkg foo 0.2
$ echo '(lang dune 3.11)' | solve_project 2>&1 | sed -E 's/3.[0-9]+/3.XX/'
$ echo '(lang dune 3.11)' | solve_project 2>&1 | dune_cmd subst '3.[0-9]+' '3.XX'
Error:
Unable to solve dependencies while generating lock directory: dune.lock

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/extra-sources.t
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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' ${default_lock_dir}/needs-patch.0.0.1.pkg
$ dune_cmd subst 'md5=[0-9a-f]+' 'md5=$HASH'< "${default_lock_dir}/needs-patch.0.0.1.pkg"
(version 0.0.1)

(build
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/implicit-dune-constraint.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependency.
> solve foo
> }

$ test "2.0.0" 2>&1 | sed -E 's/3.[0-9]+/3.XX/g'
$ test "2.0.0" 2>&1 | dune_cmd subst '3.[0-9]+' '3.XX'
Error:
Unable to solve dependencies while generating lock directory: dune.lock

Expand All @@ -27,7 +27,7 @@ dependency.
Solution for dune.lock:
- foo.0.0.1

$ test "4.0.0" 2>&1 | sed -E 's/3.[0-9]+/3.XX/g'
$ test "4.0.0" 2>&1 | dune_cmd subst '3.[0-9]+' '3.XX'
Solution for dune.lock:
- foo.0.0.1

Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/install-missing-entry.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Test missing entries in the .install file
This should give us a proper error that myfile wasn't generated

$ lockfile "myfile"
$ build_pkg test 2>&1 | sed 's#_build.*_private#$ROOT/_private#'
$ build_pkg test 2>&1 | dune_cmd subst '_build.*_private' '$ROOT/_private'
Error: entry
$ROOT/_private/default/.pkg/test.0.0.1-962f24dc2cb394442fe86368a850a9d0/source/myfile
in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Test the error cases for invalid opam repositories
$ lock() {
> out="$(dune pkg lock 2>&1)"
> local code="$?"
> echo "$out" | sed 's/character.*:/characters X-X:/g' \
> | sed 's/url ".*"/url ../g' \
> echo "$out" \
> | dune_cmd subst 'character.*:' 'characters X-X:' \
> | dune_cmd subst 'url ".*"' 'url ..' \
> | grep -v "\^"
> return $code
> }
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/log-solution.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ It should also work when the lock dir is generated by Dune:

We should be seeing that it has created a lock dir solution depending on foo.0.0.2:

$ sed -n -e "/Dependency solution for/,\$p" _build/log | grep '^#' | sed 's#.sandbox/[a-f0-9]*#.sandbox/$HASH#'
$ sed -n -e '/Dependency solution for/,$p' _build/log | grep '^#' | dune_cmd subst '.sandbox/[a-f0-9]*' '.sandbox/$HASH'
# Dependency solution for
# _build/.sandbox/$HASH/_private/default/.lock/dune.lock:
# - foo.0.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the build directory in `$dev_tool_lock_dir` with our custom build directory.
$ default_build_dir="_build"
$ custom_build_dir="_other_build"
$ default_dev_tool_lock_dir="${dev_tool_lock_dir}"
$ dev_tool_lock_dir=$(echo "${dev_tool_lock_dir}" | sed "s/^$default_build_dir/$custom_build_dir/")
$ dev_tool_lock_dir=$(echo "${dev_tool_lock_dir}" | dune_cmd subst "^$default_build_dir" "$custom_build_dir")

Create a configuration with this custom build directory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ file copying step rather than the build step.
$ echo "(version 0.0.1)" > ${default_lock_dir}/foo.pkg

The foo.install file in files/ should have been copied over.
$ build_pkg foo 2>&1 | sed 's/copyfile/open/'
$ build_pkg foo
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/pkg/opam-source-conversion.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ Test conversion of opam sources into lock dir package specifications

$ rm -rf ${default_lock_dir}

$ solve testpkg 2>&1 | sed -E 's#.*.sandbox/[^/]+#.sandbox/$SANDBOX#g' | sed '/File "/q'
$ solve testpkg
Solution for dune.lock:
- testpkg.0.0.1

$ showpkg | sed -e "s#$PWD#<pwd>#"
$ showpkg | dune_cmd subst "$PWD" '<pwd>'
(version 0.0.1)

(source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ Therefore we modify the lockfile here to remove these from the opam file:
The value for "jobs" should always be 1.

$ GROUP="$(id -gn)"
> build_pkg testpkg 2>&1 | sed "s/$GROUP/GROUP/g"
> build_pkg testpkg 2>&1 | dune_cmd subst "$GROUP" 'GROUP'
1
GROUP
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/opam-var/opam-var-os.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ separately here:
- testpkg.0.0.1

$ ocaml_version="$(ocaml -vnum)"
$ build_pkg testpkg 2>&1 | sed "s/$ocaml_version/OCAML_VERSION/g"
$ build_pkg testpkg 2>&1 | dune_cmd subst "$ocaml_version" 'OCAML_VERSION'
OCAML_VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ opam-var-unsupported.t
(run echo %{toplevel})
(run echo %{stublibs}))))))

$ build_pkg testpkg 2>&1 | sed -E 's#.*.sandbox/[^/]+#.sandbox/$SANDBOX#g'
$ build_pkg testpkg 2>&1 | dune_cmd subst '.*.sandbox/[^/]+' '.sandbox/$SANDBOX'
dune
.sandbox/$SANDBOX/_private/default/.pkg/testpkg.0.0.1-d349dc24837a78e7f391d386e4fcec8d/source
.sandbox/$SANDBOX/_private/default/.pkg/testpkg.0.0.1-d349dc24837a78e7f391d386e4fcec8d/target
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/pin-depends.t
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Pin to an HTTP archive detects wrong hash
> (name foo)
> (libraries bar))
> EOF
$ sed -i.tmp "s/$MD5_CHECKSUM/92449184682b45b5f07e811fdd61d35f/g" ${default_lock_dir}/bar.1.0.0.pkg
$ dune_cmd subst "$MD5_CHECKSUM" '92449184682b45b5f07e811fdd61d35f' ${default_lock_dir}/bar.1.0.0.pkg
$ rm -rf already-served
$ dune build 2>&1 | grep -v "md5"
File "dune.lock/bar.1.0.0.pkg", line 6, characters 12-48:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Package sources can be set to git and be nested:
> (package (name bar)))
> EOF

$ dune pkg lock 2>&1 | sed 's#git+file://.*/#$URL#'
$ dune pkg lock 2>&1 | dune_cmd subst 'git\+file://.*/' '$URL'
File "dune-project", line 5, characters 1-21:
5 | (package (name bar)))
^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/pin-stanza/git-source.t
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ than the tag is pointing to (still the initial commit):

In this case Dune can't determine which reference to use and will error out:

$ dune_pkg_lock_normalized 2>&1 | sed "s|$PWD|\$PWD|"
$ dune_pkg_lock_normalized 2>&1 | dune_cmd subst "$PWD" '$PWD'
Error: Reference "duplicated" in remote
"file://$PWD/_repo"
is ambiguous
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/pin-stanza/no-package.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here we try to pin a package to a source that doesn't define said package:
> (depends bar))
> EOF

$ dune pkg lock 2>&1 | sed 's#file://.*#$URL#g'
$ dune pkg lock 2>&1 | dune_cmd subst 'file://.*' '$URL'
File "dune-project", line 4, characters 1-21:
4 | (package (name bar)))
^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ We are unable to pin projects that the version of dune doesn't understand.
# The location here is messed up b/c we are using a source path (incorrectly)
# to construct the project

$ dune pkg lock 2>&1 | sed -E 's/3.[0-9]+/3.XX/g'
$ dune pkg lock 2>&1 | dune_cmd subst '3.[0-9]+' '3.XX'
File "dune-project", line 1, characters 11-16:
1 | (lang dune 3.XX)
^^^^^
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/pkg/pkg-extract-fail.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build this package and check for sufficient error handling
$ solve foo
Solution for dune.lock:
- foo.0.0.1
$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | sed "s/'[0-9]*'/X/"
$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | dune_cmd subst "'[0-9]*'" X
Error: failed to extract 'corrupted.tar'
Reason: 'tar' failed with non-zero exit code X and output:

Expand All @@ -35,7 +35,7 @@ captured
Solution for dune.lock:
- foo.0.0.1

$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | sed "s/'[0-9]*'/X/"
$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | dune_cmd subst "'[0-9]*'" X
Error: failed to extract 'corrupted.tar.gz'
Reason: 'tar' failed with non-zero exit code X and output:

Expand All @@ -56,6 +56,6 @@ unzip error message a bit less clear
Solution for dune.lock:
- foo.0.0.1

$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | sed "s/'[0-9]*'/X/"
$ build_pkg foo 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | dune_cmd subst "'[0-9]*'" X
Error: failed to extract 'corrupted.zip'
Reason: 'unzip' failed with non-zero exit code X and output:
4 changes: 3 additions & 1 deletion test/blackbox-tests/test-cases/pkg/set-ocamlfind-destdir.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ install and build commands.
> (install (run sh -c "echo [install] OCAMLFIND_DESTDIR=$OCAMLFIND_DESTDIR"))
> EOF

$ build_pkg test 2>&1 | sed "s#$(pwd)#PWD#" | sed 's#\.sandbox/.*/_private#\.sandbox/SANDBOX/_private#'
$ build_pkg test 2>&1 \
> | dune_cmd subst "$PWD" PWD \
> | dune_cmd subst '\.sandbox/.*/_private' '.sandbox/SANDBOX/_private'
[build] OCAMLFIND_DESTDIR=PWD/_build/.sandbox/SANDBOX/_private/default/.pkg/test.0.0.1-b793a9f8326ede0e03bacae4740bd81b/target/lib
[install] OCAMLFIND_DESTDIR=PWD/_build/.sandbox/SANDBOX/_private/default/.pkg/test.0.0.1-b793a9f8326ede0e03bacae4740bd81b/target/lib
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/substitute.t
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Now with variables set
> (substitute defined.ml.in defined.ml)
> (system "cat defined.ml")))
> EOF
$ build_pkg test 2>&1 | sed 's/%{os}% is.*/%{os}% is $REDACTED/g'
$ build_pkg test 2>&1 | dune_cmd subst '%\{os\}% is.*' '%{os}% is $REDACTED'
We substitute '%{name}%' into 'test' and '%{_:name}%' into 'test'
And '%{version}%' is set to '0.0.1'
There is also some paths set:
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/pkg/toolchain-installation.t
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ variable which includes the test sandbox path which is different each
time the tests runs. Strip the hash out of the toolchain directory
name so the output is consistent across test runs.
$ remove_hash() {
> sed 's/\(ocaml-base-compiler.1-\)[^/]*/\1HASH/'
> dune_cmd subst 'ocaml-base-compiler.1-[^/]+' 'ocaml-base-compiler.1-HASH'
> }

Attempt to build the project. This will fail due to the fake compiler,
but the fake compiler will end up installed as a toolchain package.
Also test that XDG_CACHE_HOME is respected.
$ XDG_CACHE_HOME=$PWD/fake-cache DUNE_CONFIG__TOOLCHAINS=enabled build_pkg ocaml-base-compiler 2>&1 | remove_hash
$ XDG_CACHE_HOME=$PWD/fake-cache DUNE_CONFIG__TOOLCHAINS=enabled build_pkg ocaml-base-compiler

Enumerate the contents of the fake toolchains directory:
$ find fake-cache/dune/toolchains | sort | remove_hash
Expand All @@ -89,7 +89,7 @@ Enumerate the contents of the fake toolchains directory:
fake-cache/dune/toolchains/ocaml-base-compiler.1-HASH/target/bin/ocamlc

Also test that DUNE_CACHE_ROOT is respected.
$ DUNE_CACHE_ROOT=$PWD/other-fake-cache DUNE_CONFIG__TOOLCHAINS=enabled build_pkg ocaml-base-compiler 2>&1 | remove_hash
$ DUNE_CACHE_ROOT=$PWD/other-fake-cache DUNE_CONFIG__TOOLCHAINS=enabled build_pkg ocaml-base-compiler

Enumerate the contents of the fake toolchains directory:
$ find other-fake-cache/toolchains/ | sort | remove_hash
Expand Down
4 changes: 3 additions & 1 deletion test/blackbox-tests/test-cases/pkg/toolchain-variables.t
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ We generate a fake package to use it
We try to build the dependency to show that it echoes the wong path. Until we
fix the problem, it shows the sandbox path

$ XDG_CACHE_HOME=$PWD/fake-cache dune build @pkg-install 2>&1 | sed -E 's#[[:alnum:]]{32}#<hash>#g' | sed 's#[^ ]*_build#$TESTCASE_ROOT/_build#g'
$ XDG_CACHE_HOME=$PWD/fake-cache dune build @pkg-install 2>&1 \
> | dune_cmd subst '[[:alnum:]]{32}' '<hash>' \
> | dune_cmd subst '[^ ]*_build' '$TESTCASE_ROOT/_build'
$TESTCASE_ROOT/_build/.sandbox/<hash>/_private/default/.pkg/ocaml-base-compiler.1-<hash>/target/share/ocaml-base-compiler

14 changes: 10 additions & 4 deletions test/blackbox-tests/test-cases/pkg/unavailable-package-source.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ Demonstrate what happens when we try to fetch from a source that doesn't exist:
> }

Local file system
$ runtest "(copy \"$PWD/dummy\")" 2>&1 | sed "s#$(pwd)#PWD#" | sed '/ *^\^*$/d' | sed '\#^File ".*dune.lock/foo.pkg", line 2, characters#d'
$ runtest "(copy \"$PWD/dummy\")" 2>&1 \
> | dune_cmd subst "$PWD" 'PWD' \
> | dune_cmd delete ' *\^\^*$' \
> | dune_cmd delete '^File ".*dune.lock/foo.pkg", line 2, characters'
2 | (source (copy "PWD/dummy"))
Error:
PWD/dummy
does not exist

Git
$ runtest "(fetch (url \"git+file://$PWD/dummy\"))" 2>&1 \
> | sed "s#$(pwd)#PWD#" \
> | dune_cmd subst "$PWD" 'PWD' \
> | sanitize_pkg_digest foo.dev \
> | sed -E 's#/url/[a-f0-9]+#/url/DIGEST#'
> | dune_cmd subst '/url/[a-f0-9]+' '/url/DIGEST'
fatal: 'PWD/dummy' does not appear to be a git repository
fatal: Could not read from remote repository.

Expand All @@ -40,6 +43,9 @@ Git

HTTP

$ runtest "(fetch (url \"https://0.0.0.0:35000\"))" 2>&1 | sed -ne '/Error:/,$ p' | sed '/^Reason/ q' | sed "s/'[0-9]*'/X/"
$ runtest "(fetch (url \"https://0.0.0.0:35000\"))" 2>&1 \
> | sed -ne '/Error:/,$ p' \
> | sed '/^Reason/ q' \
> | dune_cmd subst "'[0-9]*'" 'X'
Error: failed to extract 'download'
Reason: 'tar' failed with non-zero exit code X and output:
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/pkg/variables.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Now we demonstrate we get a proper error from invalid .config files:
> ))
> EOF

$ build_pkg test 2>&1 | sed 's/File .*:/File $REDACTED:/'
$ build_pkg test 2>&1 | dune_cmd subst 'File .*:' 'File $REDACTED:'
Error:
File $REDACTED:
1 | this is dummy text
Expand Down
21 changes: 13 additions & 8 deletions test/blackbox-tests/test-cases/pkg/withenv-path.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ using the withenv action.
This path is system-specific so we need to be able to remove it from the output.
$ DUNE_PATH=$(dirname $(which dune))

To workaround some shell weirdness about setting variables like PATH in the
presence of shell functions we use dune_cmd with an absolute path:

$ DUNE_CMD=$(which dune_cmd)

$ make_lockdir

Make some packages so that the test package can have dependencies:
Expand All @@ -21,7 +26,7 @@ Printing out PATH without setting it:
> (system "echo PATH=$PATH"))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=DUNE_PATH:/bin

Setting PATH to a specific value:
Expand All @@ -33,7 +38,7 @@ Setting PATH to a specific value:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test
PATH=/tmp/bin

Attempting to add a path to PATH replaces the entire PATH:
Expand All @@ -45,7 +50,7 @@ Attempting to add a path to PATH replaces the entire PATH:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=/tmp/bin:DUNE_PATH:/bin

Try adding multiple paths to PATH:
Expand All @@ -59,7 +64,7 @@ Try adding multiple paths to PATH:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=/bar/bin:/foo/bin:/tmp/bin:DUNE_PATH:/bin

Printing out PATH without setting it when the package has a dependency:
Expand All @@ -70,7 +75,7 @@ Printing out PATH without setting it when the package has a dependency:
> (system "echo PATH=$PATH"))
> EOF
$ dune clean
$ OCAMLRUNPARAM=b PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ OCAMLRUNPARAM=b PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=$TESTCASE_ROOT/_build/_private/default/.pkg/hello2.0.0.1-3cf268d89ba7f04a10a17a1a00d6d508/target/bin:$TESTCASE_ROOT/_build/_private/default/.pkg/hello1.0.0.1-2bbe9250d988b3a1dc98ca2cf6f9ab0c/target/bin:DUNE_PATH:/bin

Setting PATH to a specific value:
Expand All @@ -83,7 +88,7 @@ Setting PATH to a specific value:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test
PATH=/tmp/bin

Attempting to add a path to PATH replaces the entire PATH:
Expand All @@ -96,7 +101,7 @@ Attempting to add a path to PATH replaces the entire PATH:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=/tmp/bin:$TESTCASE_ROOT/_build/_private/default/.pkg/hello2.0.0.1-3cf268d89ba7f04a10a17a1a00d6d508/target/bin:$TESTCASE_ROOT/_build/_private/default/.pkg/hello1.0.0.1-2bbe9250d988b3a1dc98ca2cf6f9ab0c/target/bin:DUNE_PATH:/bin

Try adding multiple paths to PATH:
Expand All @@ -111,5 +116,5 @@ Try adding multiple paths to PATH:
> (system "echo PATH=$PATH")))
> EOF
$ dune clean
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | sed -e "s#$DUNE_PATH#DUNE_PATH#"
$ PATH=$DUNE_PATH:/bin build_pkg test 2>&1 | $DUNE_CMD subst "$DUNE_PATH" 'DUNE_PATH'
PATH=/bar/bin:/foo/bin:/tmp/bin:$TESTCASE_ROOT/_build/_private/default/.pkg/hello2.0.0.1-3cf268d89ba7f04a10a17a1a00d6d508/target/bin:$TESTCASE_ROOT/_build/_private/default/.pkg/hello1.0.0.1-2bbe9250d988b3a1dc98ca2cf6f9ab0c/target/bin:DUNE_PATH:/bin
Loading