From 141035d936a0b361d2802499fd9b824e8c6a6a5e Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 18 Aug 2022 16:32:58 +0200 Subject: main: honor configuration for target_file name ... also when determining default module or target. --- test/end-to-end/cli/defaults.sh | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 test/end-to-end/cli/defaults.sh (limited to 'test/end-to-end/cli/defaults.sh') 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 === -- cgit v1.2.3