aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMAddTests
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@kde.org>2015-05-18 19:12:06 +0100
committerAlex Merry <alex.merry@kde.org>2015-05-18 20:21:11 +0100
commitbe390dcc4d77d7faa95d040b1a346ac3c0405eac (patch)
tree1f04390ac4d186466fb2da2d02b4f3e12e422abb /tests/ECMAddTests
parent9f96174b61fbc1145fda4cfba573361a0aa8746d (diff)
downloadextra-cmake-modules-be390dcc4d77d7faa95d040b1a346ac3c0405eac.tar.gz
extra-cmake-modules-be390dcc4d77d7faa95d040b1a346ac3c0405eac.tar.bz2
Add arguments to ecm_add_tests for listing added tests.
This makes it convenient to make further modifications to the tests, such as setting properties on either the tests or the targets. CHANGELOG: New arguments for ecm_add_tests(). BUG: 345797 REVIEW: 123841
Diffstat (limited to 'tests/ECMAddTests')
-rw-r--r--tests/ECMAddTests/multi_tests/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ECMAddTests/multi_tests/CMakeLists.txt b/tests/ECMAddTests/multi_tests/CMakeLists.txt
index ca434773..0133c7d6 100644
--- a/tests/ECMAddTests/multi_tests/CMakeLists.txt
+++ b/tests/ECMAddTests/multi_tests/CMakeLists.txt
@@ -10,6 +10,7 @@ target_include_directories(testhelper PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
enable_testing()
include(ECMAddTests)
+include(../../test_helpers.cmake)
# clean up to avoid false-positives from check_files.cmake
file(REMOVE
@@ -24,12 +25,18 @@ file(REMOVE
"${CMAKE_CURRENT_BINARY_DIR}/test9.txt"
)
+set(exp_target_names "test1;test2;test3")
+set(exp_test_names "test1;test2;test3")
ecm_add_tests(
test1.cpp
test2.cpp
test3.cpp
LINK_LIBRARIES testhelper
+ TARGET_NAMES_VAR target_names
+ TEST_NAMES_VAR test_names
)
+assert_vars_setequal(target_names exp_target_names)
+assert_vars_setequal(test_names exp_test_names)
# check targets exist
get_property(_dummy TARGET test1 PROPERTY TYPE)
get_property(_dummy TARGET test2 PROPERTY TYPE)
@@ -112,13 +119,19 @@ if (NOT _is_bundle)
endif()
+set(exp_target_names "test8;test9")
+set(exp_test_names "p_test8;p_test9")
ecm_add_tests(
test8.cpp
test9.cpp
LINK_LIBRARIES testhelper
NAME_PREFIX p_
GUI
+ TARGET_NAMES_VAR target_names
+ TEST_NAMES_VAR test_names
)
+assert_vars_setequal(target_names exp_target_names)
+assert_vars_setequal(test_names exp_test_names)
get_property(_dummy TARGET test8 PROPERTY TYPE)
get_property(_dummy TARGET test9 PROPERTY TYPE)
get_property(_dummy TEST p_test8 PROPERTY TIMEOUT)