summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-03-07 16:37:22 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-03-13 17:28:59 +0100
commite315c8ff4ebc52c0081e9e3df717a080c5d7f41d (patch)
tree6edd036038217df0ca4126c727d71c19e0db9af9 /test
parent46555aed73791cba5eb1f1c6df1d00e2c02f3886 (diff)
downloadjustbuild-e315c8ff4ebc52c0081e9e3df717a080c5d7f41d.tar.gz
Test: Extend basic GC test for compatible
Diffstat (limited to 'test')
-rw-r--r--test/end-to-end/gc/basic.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/end-to-end/gc/basic.sh b/test/end-to-end/gc/basic.sh
index 106f4b49..dabb6dcf 100644
--- a/test/end-to-end/gc/basic.sh
+++ b/test/end-to-end/gc/basic.sh
@@ -20,6 +20,10 @@ readonly JUST="${PWD}/bin/tool-under-test"
readonly LBR="${TEST_TMPDIR}/local-build-root"
readonly TOOLS_DIR="${TEST_TMPDIR}/tools"
readonly OUT="${TEST_TMPDIR}/out"
+BUILD_ARGS="--local-build-root ${LBR}"
+if [ -n "${COMPATIBLE:-}" ]; then
+ BUILD_ARGS="$BUILD_ARGS --compatible"
+fi
# Have tools in the "outside environment" to later demonstrate
# that the action was _not_ rerun.
@@ -64,14 +68,14 @@ EOF
cat TARGETS
# Build to fill the cache
-"${JUST}" build --local-build-root "${LBR}" \
+"${JUST}" build ${BUILD_ARGS} \
-D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' 2>&1
# Demonstrate that from now on, we don't build anything any more
rm -rf "${TOOLS_DIR}"
# Verify the large file is in cache
-"${JUST}" install --local-build-root "${LBR}" -o "${OUT}/out-large" \
+"${JUST}" install ${BUILD_ARGS} -o "${OUT}/out-large" \
-D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' large 2>&1
wc -c "${OUT}/out-large/out.txt"
test $(cat "${OUT}/out-large/out.txt" | wc -c) -gt 100000
@@ -80,7 +84,7 @@ test $(cat "${OUT}/out-large/out.txt" | wc -c) -gt 100000
"${JUST}" gc --local-build-root "${LBR}" 2>&1
# Use the tree
-"${JUST}" build --local-build-root "${LBR}" \
+"${JUST}" build ${BUILD_ARGS} \
-D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' tree 2>&1
# collect garbage again
@@ -92,7 +96,7 @@ wc -c "${OUT}/root.tar"
test $(cat "${OUT}/root.tar" | wc -c) -lt 100000
# Verify that the tree is fully in cache
-"${JUST}" install --local-build-root "${LBR}" -o "${OUT}/out-tree" \
+"${JUST}" install ${BUILD_ARGS} -o "${OUT}/out-tree" \
-D '{"ENV": {"TOOLS": "'${TOOLS_DIR}'"}}' tree 2>&1
ls -R "${OUT}/out-tree"
test -f "${OUT}/out-tree/out/hello/world/tree/hello.txt"