[CMake] Running TEST_P from GTest with CMake

David Doria daviddoria at gmail.com
Fri Feb 5 14:58:17 EST 2016


I have been successfully using CMake's GTEST_ADD_TESTS to run GTest
TEST and TEST_F blocks defined in a source file. However, I now need
to pass some arguments (filenames that I want CMake to produce
including things like ${CMAKE_SOURCE_DIR}) to the GTests, and it seems
like the way to do this is with INSTANTIATE_TEST_CASE_P that calls
TEST_P blocks with a list of parameters. It seems like GTEST_ADD_TESTS
does not handle this. Does anyone know how to do something like this
through CMake?

Thanks,

David


More information about the CMake mailing list