From 989cde7dc99e4ce789b1520cd622a8049d6b85f9 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 12 Apr 2024 16:03:03 +0200 Subject: 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. --- test/end-to-end/cli/conflict-report.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test') 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 -- cgit v1.2.3