Commit 6c89931
committed
test: discover gtest tests at ctest startup, not POST_BUILD
CMake 4.4.0's generated discovery scripts omit TEST_TARGET, so every
target's POST_BUILD discovery shares one JSON file
(cmake_test_discovery_e3b0c44298.json, sha256 of the empty string).
Ninja links test binaries in parallel and their discovery steps race on
that file: one truncates it while another parses, producing the
intermittent macOS failure
ParseTestList.cmake:96: string sub-command JSON failed parsing json
string ... Line 1, Column 1: Syntax error
Fixed upstream in cmake 4.4.1, but Homebrew CI runners ship 4.4.0.
PRE_TEST discovery runs serially at ctest startup, immune to the race
on any cmake version. Measured cost: 0.8s to enumerate all 772 tests,
cached thereafter (0.12s); build step drops its ~28 post-link discovery
executions.1 parent 4915b55 commit 6c89931
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
0 commit comments