aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/BuildHostTests.cmake13
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/Modules/BuildHostTests.cmake b/cmake/Modules/BuildHostTests.cmake
index fab89bb4..c254e30a 100644
--- a/cmake/Modules/BuildHostTests.cmake
+++ b/cmake/Modules/BuildHostTests.cmake
@@ -13,21 +13,28 @@ function("_teachos_add_tests_impl" NAME TYPE)
"**/test_support/**.cpp"
)
+ list(FILTER TEST_SUPPORT_SOURCES EXCLUDE REGEX ".tests.cpp")
+
message(STATUS "Registering test support sources for ${NAME}::${TYPE}")
foreach(SOURCE IN LISTS TEST_SUPPORT_SOURCES)
message(DEBUG "${CMAKE_MESSAGE_INDENT}${SOURCE}")
endforeach()
-
target_sources("${LIBRARY_TARGET}" PRIVATE
${TEST_SUPPORT_SOURCES}
)
+ if(TYPE STREQUAL "stress_tests")
+ set(FILE_COMPONENT "stress")
+ else()
+ set(FILE_COMPONENT "tests")
+ endif()
+
file(GLOB_RECURSE
TEST_SOURCES
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
CONFIGURE_DEPENDS
- "*.tests.cpp"
+ "*.${FILE_COMPONENT}.cpp"
)
message(STATUS "Registering test sources for ${NAME}::${TYPE}")
@@ -57,7 +64,7 @@ function("_teachos_add_tests_impl" NAME TYPE)
catch_discover_tests("${NAME}::${TYPE}"
REPORTER junit
- EXTRA_ARGS --reporter console::out=-::colour-mode=ansi
+ EXTRA_ARGS "--reporter console::out=-::colour-mode=ansi"
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/bht_results"
OUTPUT_SUFFIX ".xml"
ADD_TAGS_AS_LABELS