summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-12 16:03:03 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-04-12 18:09:38 +0200
commit989cde7dc99e4ce789b1520cd622a8049d6b85f9 (patch)
tree580958e270519c2d1a153955653795da9a501226 /test
parente7458ab863ea9b1b2e6a9b874e5fdd1dd7262c22 (diff)
downloadjustbuild-989cde7dc99e4ce789b1520cd622a8049d6b85f9.tar.gz
Target analysis: report short names of targets when describing a conflict
Configured targets, by design, cannot distinguish between a value not occuring in the configuration and occuring there with value null. Therefore, to understand the conflict, we can as well drop all the null values of the target configuration when reporting it.
Diffstat (limited to 'test')
-rwxr-xr-xtest/end-to-end/cli/conflict-report.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/end-to-end/cli/conflict-report.sh b/test/end-to-end/cli/conflict-report.sh
index 0e605402..1e5755af 100755
--- a/test/end-to-end/cli/conflict-report.sh
+++ b/test/end-to-end/cli/conflict-report.sh
@@ -129,6 +129,14 @@ cat > TARGETS <<'EOF'
, "another provided world"
]
}
+, "rule-conflict-in-config":
+ { "type": "provide"
+ , "deps": ["world", "unrelated", "universe", "greeting.txt"]
+ }
+, "simple-rule-conflict-in-config":
+ { "type": "provide"
+ , "deps": ["unrelated", "universe", "greeting.txt"]
+ }
}
EOF
@@ -164,5 +172,27 @@ grep '\["@","","","another provided world"\]' log
grep '\["@","","","provided universe"\]' log
grep '\["@","","","provided unrelated"\]' log && exit 1 || :
+# Also verify that the non-null part of the effective configuration is
+# reported.
+"${JUST}" build --local-build-root "${LBR}" rule-conflict-in-config \
+ -f log --log-limit 0 2>&1 -D '{"FOO": "bar", "NAME": "World"}' \
+ && exit 1 || :
+echo
+grep -F '[["@","","","world"],{}]' log
+grep -F '[["@","","","universe"],{}]' log
+grep -F '[["@","","","greeting.txt"],{"NAME":"World"}]' log
+grep -F '["@","","","unrelated"]' log && exit 1 || :
+echo
echo
+
+"${JUST}" build --local-build-root "${LBR}" simple-rule-conflict-in-config \
+ -f log --log-limit 0 2>&1 -D '{"FOO": "bar", "NAME": null}' \
+ && exit 1 || :
+echo
+grep -F '[["@","","","universe"],{}]' log
+grep -F '[["@","","","greeting.txt"],{}]' log
+grep -F '["@","","","unrelated"]' log && exit 1 || :
+echo
+echo
+
echo OK