Skip to content

Commit f203d26

Browse files
committed
test(e2e): match 78 link lines by name+cxx_link (path-separator agnostic)
Windows build.ninja uses backslash paths (bin\t_..exe); the previous grep used 'bin/...' so it missed them and false-failed. Match 't_<name>(.exe)? : cxx_link' — no directory prefix, so / vs \ and .exe are both irrelevant. (Windows functionality was already correct: own-main test links no gtest_main, build OK.)
1 parent 2edef20 commit f203d26

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/e2e/78_test_main_combinations.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ echo "$out" | grep -q '3 passed; 0 failed' || { echo "FAIL: summary mismatch"; e
6464
# `duplicate symbol: main`); a test relying on the framework's main MUST link it.
6565
# Match the ninja link target with an optional .exe suffix (Windows) and the
6666
# object with either .o / .obj — the gtest_main substring covers both.
67+
# Match by target name + `cxx_link` so path-separator (/, on Windows \) and the
68+
# .exe suffix don't matter. The link line is `build bin<sep><name>[.exe] : cxx_link ...`.
6769
nj=$(find target -name build.ninja | head -1)
68-
own_link="$(grep -E 'bin/t_own_main_gtest(\.exe)? :' "$nj" || true)"
69-
fw_link="$(grep -E 'bin/t_framework_main(\.exe)? :' "$nj" || true)"
70+
own_link="$(grep -E 't_own_main_gtest(\.exe)? : cxx_link' "$nj" || true)"
71+
fw_link="$(grep -E 't_framework_main(\.exe)? : cxx_link' "$nj" || true)"
7072
[[ -n "$own_link" ]] || { echo "FAIL: no link line for t_own_main_gtest"; cat "$nj"; exit 1; }
7173
[[ -n "$fw_link" ]] || { echo "FAIL: no link line for t_framework_main"; cat "$nj"; exit 1; }
7274
echo "$own_link" | grep -q 'gtest_main' && { echo "FAIL: own-main test links gtest_main (dup main)"; exit 1; }

0 commit comments

Comments
 (0)