~compiz-team/compiz/0.9.8

« back to all changes in this revision

Viewing changes to compizconfig/libcompizconfig/tests/CMakeLists.txt

Added compiz_discover_tests.

gtest_add_tests is good for the basic Google Test usage, but its source
based scanning falls short in a couple of areas - namely it requires that
there be no space between TEST* and ( and it also does not work for templated
tests.

compiz_discover_tests builds a small C++ program to parse the output
of --gtest_list_tests and adds those at make-time to the CTestTestfile.cmake
in the current binary directory. This allows us to correctly introspect the test
 binary and get /all/ the tests regardless of the source file.. Fixes: . Approved by Daniel van Vugt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
                       plugin-mock
95
95
                       setting-mock)
96
96
 
97
 
gtest_add_tests (test-ccs-object "" ${CMAKE_CURRENT_SOURCE_DIR}/test-ccs-object.cpp)
98
 
gtest_add_tests (test-context "" ${CMAKE_CURRENT_SOURCE_DIR}/test-context.cpp)
99
 
gtest_add_tests (test-plugin "" ${CMAKE_CURRENT_SOURCE_DIR}/test-plugin.cpp)
100
 
gtest_add_tests (test-setting "" ${CMAKE_CURRENT_SOURCE_DIR}/test-setting.cpp)
 
97
compiz_discover_tests (test-ccs-object)
 
98
compiz_discover_tests (test-context)
 
99
compiz_discover_tests (test-plugin)
 
100
compiz_discover_tests (test-setting)