Skip to content

GoogleTest: Fix CTest failing to report when gtest_discover_tests fails

In CMake 3.16.5, if gtest_discover_tests failed, calling CTest would result in:

Unable to find executable: foo_NOT_BUILT
Errors while running CTest

!4371 (merged) (commit dac20144) introduced a regression and now CTest reports:

No tests were found!!!

This pull request does two things:

  • Introduces a missing test case to check for CTest failure when gtest_discover_tests has failed
    • This test cases passes on v3.16.5 but fails on master since dac20144
  • Fixes the regression introduced in GoogleTestAddTests.cmake that prematurely writes an empty CTest file

Topic-rename: GoogleTest-gtest_discover_tests-failure

Edited by Brad King

Merge request reports