From b20171a41a97dbfd75a98955694eb9df5314ef27 Mon Sep 17 00:00:00 2001 From: "Klaus T. Aehlig" Date: Mon, 5 Feb 2024 11:46:34 +0100 Subject: 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. --- test/end-to-end/target-tests/glob.sh | 8 ++++---- test/end-to-end/target-tests/repo_names.sh | 4 ++-- test/end-to-end/target-tests/tree-inputs.sh | 1 + test/end-to-end/target-tests/upwards.sh | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'test/end-to-end/target-tests') diff --git a/test/end-to-end/target-tests/glob.sh b/test/end-to-end/target-tests/glob.sh index f655b3e3..131d533e 100755 --- a/test/end-to-end/target-tests/glob.sh +++ b/test/end-to-end/target-tests/glob.sh @@ -129,7 +129,7 @@ EOI do_test() { echo === Enumeration refres to targets === - ${TOOL} install -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/enum enumeration 2>&1 + ${TOOL} install -L '["env", "PATH='"${PATH}"'"]' -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/enum enumeration 2>&1 cat ${OUTDIR}/enum/keys.txt echo @@ -141,7 +141,7 @@ do_test() { echo === Glob always refres to files and directories are ignored === - ${TOOL} install -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/glob glob 2>&1 + ${TOOL} install -L '["env", "PATH='"${PATH}"'"]' -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/glob glob 2>&1 cat ${OUTDIR}/glob/keys.txt echo @@ -153,7 +153,7 @@ do_test() { echo === Globs and targets can be combined === - ${TOOL} install -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/with_target with_target 2>&1 + ${TOOL} install -L '["env", "PATH='"${PATH}"'"]' -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/with_target with_target 2>&1 cat ${OUTDIR}/with_target/keys.txt echo @@ -165,7 +165,7 @@ do_test() { echo === Globs only inspect the top-level directory of the module === - ${TOOL} install -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/not_top_level not_top_level 2>&1 + ${TOOL} install -L '["env", "PATH='"${PATH}"'"]' -C ${CONF} --local-build-root ${BUILDROOT} -o ${OUTDIR}/not_top_level not_top_level 2>&1 cat ${OUTDIR}/not_top_level/keys.txt echo diff --git a/test/end-to-end/target-tests/repo_names.sh b/test/end-to-end/target-tests/repo_names.sh index aec5996a..65929674 100755 --- a/test/end-to-end/target-tests/repo_names.sh +++ b/test/end-to-end/target-tests/repo_names.sh @@ -88,7 +88,7 @@ EOF mkdir -p .root echo == Building in A == -./bin/tool-under-test install -C bindings.json -o . --local-build-root .root --main A . back 2>&1 +./bin/tool-under-test install -L '["env", "PATH='"${PATH}"'"]' -C bindings.json -o . --local-build-root .root --main A . back 2>&1 cat back.txt grep -q 'I am A' back.txt grep -q 'This is B' back.txt @@ -96,7 +96,7 @@ grep -q 'Hello A' back.txt rm -f back.txt echo == Building in B == -./bin/tool-under-test install -C bindings.json -o . --local-build-root .root --main B . back 2>&1 +./bin/tool-under-test install -L '["env", "PATH='"${PATH}"'"]' -C bindings.json -o . --local-build-root .root --main B . back 2>&1 cat back.txt grep -q 'I am B' back.txt grep -q 'This is A' back.txt diff --git a/test/end-to-end/target-tests/tree-inputs.sh b/test/end-to-end/target-tests/tree-inputs.sh index edbe7f7e..7a0398b8 100755 --- a/test/end-to-end/target-tests/tree-inputs.sh +++ b/test/end-to-end/target-tests/tree-inputs.sh @@ -38,6 +38,7 @@ cat > src/TARGETS <<'EOF' EOF ./bin/tool-under-test install -o out --workspace-root src \ + -L '["env", "PATH='"${PATH}"'"]' \ --local-build-root .root . read_trees 2>&1 grep SUCCESS out/result diff --git a/test/end-to-end/target-tests/upwards.sh b/test/end-to-end/target-tests/upwards.sh index fb700588..d196a8e8 100755 --- a/test/end-to-end/target-tests/upwards.sh +++ b/test/end-to-end/target-tests/upwards.sh @@ -38,6 +38,7 @@ cat > src/TARGETS <<'EOF' EOF ./bin/tool-under-test install -o out --workspace-root src \ + -L '["env", "PATH='"${PATH}"'"]' \ --local-build-root .root . it 2>&1 grep OK out/out @@ -61,6 +62,7 @@ EOF ./bin/tool-under-test install -o out2 --workspace-root src \ + -L '["env", "PATH='"${PATH}"'"]' \ --local-build-root .root deep 'OK up' 2>&1 grep OK out2/out -- cgit v1.2.3