Skip to content

Commit 6345e3c

Browse files
committed
test(e2e): 195 用诊断而不是 --strict 判定
`--strict` 会把**所有**降级提升为错误,包括与本测试无关的那些 —— Windows 上 clang 报「this toolchain and platform combination emits no GNU depfile」,于是 195 在 Windows 上因为一件它并不关心的事而红。 本测试要断言的是「没有任何谓词匹配的平台上,请求该 feature 不是未知 feature 错误」,那就直接断言那条诊断不出现。
1 parent 4838952 commit 6345e3c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/e2e/195_target_cfg_feature_deps.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,19 @@ nomatchlib = { path = "../nomatch", features = ["codegen"] }
129129
EOF
130130
printf 'int main(){}\n' > nmapp/src/main.cpp
131131
cd nmapp
132-
"$MCPP" build --strict > b3.log 2>&1 || {
132+
# Asserted on the DIAGNOSTIC rather than with --strict: --strict promotes every
133+
# degradation, including unrelated ones (clang on Windows reports "this
134+
# toolchain and platform combination emits no GNU depfile"), so it would make
135+
# this test fail for a reason it is not about.
136+
"$MCPP" build > b3.log 2>&1 || {
133137
cat b3.log
134138
echo "FAIL: requesting a conditionally-populated feature failed where no predicate matches"
135139
exit 1
136140
}
141+
grep -q "does not declare requested feature" b3.log && {
142+
cat b3.log
143+
echo "FAIL: the feature was reported as undeclared where no predicate matches"
144+
exit 1
145+
}
137146

138147
echo "PASS: 195_target_cfg_feature_deps"

0 commit comments

Comments
 (0)