From 03b9b423b07a21916b8204047dbc34bf74f914fe Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 29 Oct 2012 15:46:26 +0100 Subject: Generate instances of types in the CMake tests. All modules currently have a test_modules CMake test. The new module_includes test has very similar requirements, and can obsolete the hand-maintained test_modules tests in all modules. After all test_modules have been removed in other repos, the module_includes test can be renamed to that name. The types chosen need to have a constructor which can be invoked with no arguments. QtConcurrent has no public classes which fit that description so it is still tested separately Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1 Reviewed-by: Rohan McGovern --- src/corelib/Qt5CTestMacros.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 0db83e3fb3..715ad9356e 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -102,6 +102,7 @@ function(test_module_includes) set(all_args ${ARGN}) set(includes_string "") + set(instances_string "") while(all_args) list(GET all_args 0 qtmodule) list(GET all_args 1 qtinclude) @@ -113,6 +114,10 @@ function(test_module_includes) #include #include " ) + set(instances_string + "${instances_string} + ${qtinclude} local${qtinclude}; + ") endwhile() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/module_includes/main.cpp" @@ -120,7 +125,7 @@ function(test_module_includes) ${includes_string} - int main(int, char **) { return 0; }\n" + int main(int, char **) { ${instances_string} return 0; }\n" ) add_test(module_includes ${CMAKE_CTEST_COMMAND} -- cgit v1.2.3