summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GoogleTest
diff options
context:
space:
mode:
authorRyan Thornton <ThorntonRyan@JohnDeere.com>2020-03-11 18:34:06 (GMT)
committerRyan Thornton <ThorntonRyan@JohnDeere.com>2020-03-11 20:11:00 (GMT)
commit2ba8ac07ed50b11946c52c37ddab4f65536d36ea (patch)
tree114d4ed1e212e4ec0079612ea3500e94893bdbb6 /Tests/RunCMake/GoogleTest
parent2c9680eec59fb52b4bf60b2b995101c86a906ca5 (diff)
downloadCMake-2ba8ac07ed50b11946c52c37ddab4f65536d36ea.zip
CMake-2ba8ac07ed50b11946c52c37ddab4f65536d36ea.tar.gz
CMake-2ba8ac07ed50b11946c52c37ddab4f65536d36ea.tar.bz2
GoogleTest: Fix CTest not failing if gtest_discover_tests fails
Fixes regression introduced dac201442d (GoogleTest: Optimize gtest_discover_tests, 2020-02-18). The generated CTest include files has the form: if(EXISTS "foo_tests.cmake") include("foo_tests.cmake") else() add_test(foo_NOT_BUILT foo_test_NOT_BUILT) endif() Starting in dac201442d, an empty discovery_timeout_test[1]_tests.cmake was written as soon as GoogleTestAddTests was processed. This meant, that even if test discovery would fail (due to a crash or timeout in the executable), we would always produce an empty CTest file. So instead of reporting: Unable to find executable: foo_NOT_BUILT Errors while running CTest We instead get: No tests were found!!! To fix the problem, we WRITE the file on the first call to flush_script, thus creating the file once we know we have valid output and the call to gtest_discover_tests hasn't failed. After creating the file, we then set the mode to APPEND and append to the file for every subsequent call.
Diffstat (limited to 'Tests/RunCMake/GoogleTest')
0 files changed, 0 insertions, 0 deletions