GoogleTestAddTests: tests missing due to bug in --gtest_list_tests parsing
It took me a while to figure out why I can't run certain tests any more It seems that there is a bug in parsing the output of --gtest_list_tests
. I have the following output of the gtest binary (excerpt):
NonValidatingUriSplitterTest.
test
testNullptr
simpleFormat/IpContainerFormatterTest.
simpleFormat/0 # GetParam() = ({ '[' (91, 0x5B), ']' (93, 0x5D) }, {})
simpleFormat/1 # GetParam() = ({ '[' (91, 0x5B), '"' (34, 0x22), '1' (49, 0x31), '6' (54, 0x36), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '"' (34, 0x22), ']' (93, 0x5D) }, { 20-byte object <10-01 01-01 00-00 00-00 00-00 00-00...
simpleFormat/2 # GetParam() = ({ '[' (91, 0x5B), '"' (34, 0x22), '1' (49, 0x31), '6' (54, 0x36), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '"' (34, 0x22), ',' (44, 0x2C), ' ' (32, 0x20), '"' (34, 0x22), '0' (48, 0x30), '1' (49...
simpleFormat/3 # GetParam() = ({ '[' (91, 0x5B), '"' (34, 0x22), '1' (49, 0x31), '6' (54, 0x36), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '.' (46, 0x2E), '1' (49, 0x31), '"' (34, 0x22), ',' (44, 0x2C), ' ' (32, 0x20), '"' (34, 0x22), '0' (48, 0x30), '1' (49...
LockBenchInstance/LockTest.
PERFORMANCE_SLOW_testLocks/0 # GetParam() = 5000_iters+1000_syncvals+0_readers+10_writers
PERFORMANCE_SLOW_testLocks/1 # GetParam() = 5000_iters+1000_syncvals+10_readers+0_writers
PERFORMANCE_SLOW_testLocks/2 # GetParam() = 5000_iters+1000_syncvals+1_readers+1_writers
PERFORMANCE_SLOW_testLocks/3 # GetParam() = 5000_iters+1000_syncvals+10_readers+1_writers
PERFORMANCE_SLOW_testLocks/4 # GetParam() = 5000_iters+1000_syncvals+1_readers+10_writers
PERFORMANCE_SLOW_testLocks/5 # GetParam() = 5000_iters+1000_syncvals+10_readers+10_writers
The problem is, that in gtest_discover_tests_impl
everything after simpleformat/2
is parsed as a single line, thus whatever tests come after this are not detected. I saw that by adding a debug line message(${line})
into the foreach(line ${output})
loop.
I have also tested this with cmake 3.21.3 and also with GoogleTestAddTests.cmake file from master from today.
Edited by Martin Leitner-Ankerl