diff options
author | Klaus T. Aehlig <aehlig@linta.de> | 2024-02-05 11:46:34 +0100 |
---|---|---|
committer | Klaus T. Aehlig <aehlig@linta.de> | 2024-02-05 16:24:18 +0100 |
commit | b20171a41a97dbfd75a98955694eb9df5314ef27 (patch) | |
tree | 1be0e4d5ecaf0bec2e5b198da3d9ff1c3aea0d0d /test/end-to-end/cli | |
parent | d71277e0a0b6ad60b6ecce4382b7f7f3e35c3282 (diff) | |
download | justbuild-b20171a41a97dbfd75a98955694eb9df5314ef27.tar.gz |
end-to-end tests: inherit path
... for test actions, by setting an appropriate local launcher. In
this way, the tests can also be run on systems where sh does not
pull in enough paths to have all the "usual" tools available.
Diffstat (limited to 'test/end-to-end/cli')
-rw-r--r-- | test/end-to-end/cli/build-p.sh | 10 | ||||
-rw-r--r-- | test/end-to-end/cli/install.sh | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/test/end-to-end/cli/build-p.sh b/test/end-to-end/cli/build-p.sh index 853ab3e3..9a829fe7 100644 --- a/test/end-to-end/cli/build-p.sh +++ b/test/end-to-end/cli/build-p.sh @@ -31,23 +31,23 @@ cat > TARGETS <<'EOF' } EOF -"${JUST}" build --local-build-root "${BUILDROOT}" --dump-artifacts out.json 2>&1 +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" --dump-artifacts out.json 2>&1 echo cat out.json # foo/bar is the output artifact, and it is a tree [ $(jq -rM '."foo/bar"."file_type"' out.json) = "t" ] # Therefore, foo is not an output artifact, so requesting -P leaves stdout empty -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo > foo.txt +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo > foo.txt [ -f foo.txt ] && [ -z "$(cat foo.txt)" ] # Requesting foo/bar gives a human-readable description of the tree -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar | grep baz +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar | grep baz # going deepter into the tree we stil can get human-readable tree descriptions -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting | grep hello.txt +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting | grep hello.txt # Files inside the tree can be retrieved -"${JUST}" build --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting/hello.txt | grep World +"${JUST}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -P foo/bar/baz/greeting/hello.txt | grep World echo OK diff --git a/test/end-to-end/cli/install.sh b/test/end-to-end/cli/install.sh index b3019e5b..1f06af76 100644 --- a/test/end-to-end/cli/install.sh +++ b/test/end-to-end/cli/install.sh @@ -45,7 +45,7 @@ echo # Verify non-interference of install cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" 2>&1 echo ls -al "${OUTDIR}" @@ -55,7 +55,7 @@ grep Original unrelated.txt # Verify non-interference of install cd "${SRCDIR}" -"${TOOL}" build --local-build-root "${BUILDROOT}" \ +"${TOOL}" build -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" \ --dump-artifacts "${OUTDIR}/artifacts.json" 2>&1 echo ID=$(jq -rM '."hello.txt".id' "${OUTDIR}/artifacts.json") @@ -73,7 +73,7 @@ grep Original unrelated.txt # Verify non-interference of install (overwrite existing file with symlink) cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" @@ -86,7 +86,7 @@ grep Original unrelated.txt rm -f ${OUTDIR}/hello.txt ln -s /noexistent ${OUTDIR}/hello.txt cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" @@ -99,7 +99,7 @@ grep Original unrelated.txt rm -f ${OUTDIR}/content.txt ln -s /noexistent ${OUTDIR}/content.txt cd "${SRCDIR}" -"${TOOL}" install --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 +"${TOOL}" install -L '["env", "PATH='"${PATH}"'"]' --local-build-root "${BUILDROOT}" -o "${OUTDIR}" symlink 2>&1 echo ls -al "${OUTDIR}" |