summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-07-18 22:25:56 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-24 08:44:27 +0200
commit45cb8be4f9ab2b5b823dda104376b159c9123163 (patch)
tree833e53808d216375ca10a84a384775f897f6c49f /tests/auto/cmake/CMakeLists.txt
parent4eb64827515f7d72e3c5cf259c4bc2c1cc0d58bf (diff)
Add tests of the various testlib definition possibilities.
The behavior of QTEST_MAIN depends on whether QT_GUI_LIB or QT_WIDGETS_LIB is defined. It could create a QGuiApplication or QApplication which could cause linking issues if the corresponding library is not linked to. The failure cases are also tested. Change-Id: I61ed0bc760564ef42ce1dbd86c83c06348c860ff Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/cmake/CMakeLists.txt')
-rw-r--r--tests/auto/cmake/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 55db94db52..d9eb683f1b 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -74,3 +74,16 @@ if (NOT WIN32)
endif()
expect_pass(test_private_includes)
expect_pass(test_modules)
+expect_pass(test_testlib_definitions)
+
+expect_fail(test_testlib_no_link_gui)
+expect_fail(test_testlib_no_link_widgets)
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
+)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/"
+)