Skip to content

Commit 117cb8d

Browse files
committed
e2e 211 compares the fixture by its own name, which the 8.3 and long spellings of a Windows temporary directory share
1 parent de534da commit 117cb8d

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎tests/e2e/211_configure_only_cdb.sh‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,19 @@ normal = lambda p: p.replace("\\", "/").rstrip("/")
7878
test = next(e for e in entries if normal(e["file"]).endswith("/tests/test_smoke.cpp"))
7979
main = next(e for e in entries if normal(e["file"]).endswith("/src/main.cpp"))
8080
args = test["arguments"]
81+
# Compared by the fixture directory's own name: Windows may spell the same
82+
# temporary directory with its 8.3 short form in one field and its long form in
83+
# another (`RUNNER~1` against `runneradmin`), and the name below it is the same
84+
# in both.
8185
project = normal(test["file"])[: -len("/tests/test_smoke.cpp")]
82-
fixture = project.rsplit("/", 1)[0]
83-
expected_include = f"{fixture}/devkit/include".casefold()
84-
include_args = {
86+
fixture_name = project.rsplit("/", 2)[-2]
87+
expected_tail = f"/{fixture_name}/devkit/include".casefold()
88+
include_args = [
8589
normal(a[2:]).casefold()
8690
for a in args
8791
if a[:2].casefold() == "-i"
88-
}
89-
assert expected_include in include_args, (expected_include, args)
92+
]
93+
assert any(i.endswith(expected_tail) for i in include_args), (expected_tail, args)
9094
assert any("MCPP_CONFIGURE_ONLY_TEST_FLAG=1" in a for a in args), args
9195
assert not any("MCPP_CONFIGURE_ONLY_TEST_FLAG=1" in a for a in main["arguments"]), main
9296
PY

0 commit comments

Comments
 (0)