aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2020-06-09 12:07:59 +0200
committerCristian Adam <cristian.adam@qt.io>2020-06-09 12:44:29 +0000
commitbe339abb1682a9887d29c5a0fe3746300f52380f (patch)
tree123799d7a9f06e995feced928300a2afeaccc7d4 /cmake
parent3bd22bd2d7ef756bfcba4e12c7a043444f6b3d1d (diff)
CMake Build: Fix unittests
Change-Id: I4214954d880d19dbe9a070d031c417dc3caf068a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtCreatorAPI.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake
index 4249e71824..1c5dbbcece 100644
--- a/cmake/QtCreatorAPI.cmake
+++ b/cmake/QtCreatorAPI.cmake
@@ -679,11 +679,14 @@ function(add_qtc_test name)
endif()
endfunction()
-function(finalize_qtc_gtest test_name)
+function(finalize_qtc_gtest test_name exclude_sources_regex)
if (NOT TARGET ${test_name})
return()
endif()
get_target_property(test_sources ${test_name} SOURCES)
+ if (exclude_sources_regex)
+ list(FILTER test_sources EXCLUDE REGEX "${exclude_sources_regex}")
+ endif()
include(GoogleTest)
gtest_add_tests(TARGET ${test_name} SOURCES ${test_sources} TEST_LIST test_list)