diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-10-29 15:46:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-31 07:16:03 +0100 |
commit | 03b9b423b07a21916b8204047dbc34bf74f914fe (patch) | |
tree | 093b850fae8648ce2973bc7e9052a54cf17ed929 /src | |
parent | 21d74702d18b2aa745ea847b5aa0fb1c970df817 (diff) |
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 <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/Qt5CTestMacros.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
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 <Qt${qtmodule}> #include <Qt${qtmodule}/Qt${qtmodule}>" ) + 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} |