Skip to content

Commit 6e73682

Browse files
committed
test(e2e): 118 asserts the depfile degradation on Windows instead of a capability it lacks
Windows plus a GNU-dialect toolchain — which is what the CI leg's clang is — genuinely cannot track textual includes: the depfile GCC emits for a module TU needs an awk filter to be loadable by ninja, and native Windows has no awk. #257 does not fix that platform; it makes the engine SAY so through diag::degraded, and the Windows CI log carries that message 13 times. Dropping the `# requires: gcc` gate pointed the test at that platform for the first time, where it asserted a rebuild that cannot happen. Asserting the capability there would be wrong, and re-gating the test to POSIX would put the gap back out of sight. So on Windows the test now asserts the degradation IS reported and stops. That is the stronger contract: silence is the actual defect, and this pins it. Everywhere else the rebuild assertions are unchanged.
1 parent 8eedf15 commit 6e73682

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

tests/e2e/118_purview_include_rebuild.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ subst() { # subst <sed-expr> <file>
2424
sed "$1" "$2" > "$2.tmp" && mv "$2.tmp" "$2"
2525
}
2626

27+
# Windows + a GNU-dialect toolchain (the CI leg's clang) is the one
28+
# combination that genuinely CANNOT track textual includes: the depfile GCC
29+
# emits for a module TU needs an awk filter to be loadable by ninja, and
30+
# native Windows has no awk. #257 does not fix that — it makes the engine SAY
31+
# so, through diag::degraded. On that platform this test therefore asserts
32+
# the degradation is reported rather than asserting a capability the build
33+
# does not have; silence would be the actual defect.
34+
case "$(uname -s)" in
35+
MINGW*|MSYS*|CYGWIN*) EXPECT_TRACKING=0 ;;
36+
*) EXPECT_TRACKING=1 ;;
37+
esac
38+
DEGRADED_MSG="emits no GNU depfile"
39+
2740
TMP=$(mktemp -d)
2841
trap "rm -rf $TMP" EXIT
2942

@@ -55,9 +68,22 @@ name = "purviewinc"
5568
version = "0.1.0"
5669
EOF
5770

58-
out="$("$MCPP" run 2>&1 | tail -1)"
71+
run_log=$("$MCPP" run 2>&1)
72+
out="$(echo "$run_log" | tail -1)"
5973
[[ "$out" == "41" ]] || { echo "unexpected initial output: $out"; exit 1; }
6074

75+
if [[ $EXPECT_TRACKING -eq 0 ]]; then
76+
echo "$run_log" | grep -q "$DEGRADED_MSG" || {
77+
echo "$run_log"
78+
echo "FAIL: this toolchain/platform cannot emit a depfile, and said nothing."
79+
echo " A capability gap must be reported, not silent (#257)."
80+
exit 1
81+
}
82+
echo " windows: depfile degradation reported as expected; rebuild tracking not asserted"
83+
echo "OK"
84+
exit 0
85+
fi
86+
6187
subst 's/41/42/' src/vals.inc
6288

6389
out="$("$MCPP" run 2>&1 | tail -1)"

0 commit comments

Comments
 (0)