diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-08-18 16:32:58 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-08-19 14:09:01 +0200 |
commit | 141035d936a0b361d2802499fd9b824e8c6a6a5e (patch) | |
tree | 0f5bc621a5fed369c9cbaaaccf03d4d83ad9e948 /test/end-to-end/cli/defaults.sh | |
parent | 37f0272bf0d6c75b62c7bb10f3d1b80e1d1c41fb (diff) | |
download | justbuild-141035d936a0b361d2802499fd9b824e8c6a6a5e.tar.gz |
main: honor configuration for target_file name
... also when determining default module or target.
Diffstat (limited to 'test/end-to-end/cli/defaults.sh')
-rw-r--r-- | test/end-to-end/cli/defaults.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/end-to-end/cli/defaults.sh b/test/end-to-end/cli/defaults.sh new file mode 100644 index 00000000..70ae7ec7 --- /dev/null +++ b/test/end-to-end/cli/defaults.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +TOOL=$(realpath ./bin/tool-under-test) +mkdir -p .root +BUILDROOT=$(realpath .root) +mkdir -p out +OUTDIR=$(realpath out) + + +mkdir src +cd src +touch ROOT + +cat > repos.json <<'EOF' +{"repositories": {"": {"target_file_name": "TARGETS.local"}}} +EOF +export CONF=$(realpath repos.json) + +cat > TARGETS.local <<'EOF' +{"a": {"type": "file_gen", "name": "a.txt", "data": "A-top-level"}} +EOF + +echo +echo === Default target === +${TOOL} build -C $CONF --local-build-root ${BUILDROOT} -Pa.txt | grep top-level + + +echo +echo === top-level module found === + +mkdir foo +cd foo +cat > TARGETS <<'EOF' +{"a": {"type": "file_gen", "name": "a.txt", "data": "WRONG"}} +EOF +${TOOL} build -C $CONF --local-build-root ${BUILDROOT} -Pa.txt | grep top-level + +echo === correct root referece === + +cat > TARGETS.local <<'EOF' +{"a": {"type": "file_gen", "name": "b.txt", "data": "A-local"} +, "": {"type": "install", "deps": ["a", ["", "a"]]} +} +EOF + +${TOOL} install -C $CONF --local-build-root ${BUILDROOT} -o ${OUTDIR}/top-ref 2>&1 +echo +grep top-level ${OUTDIR}/top-ref/a.txt +grep local ${OUTDIR}/top-ref/b.txt + +echo +echo === DONE === |