Skip to content

Commit 4b794dd

Browse files
committed
Add costs
1 parent 67bf9aa commit 4b794dd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

cmake/AddTestcase.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ set(RTTR_LSAN_SUPPRESSION_FILE ${CMAKE_CURRENT_LIST_DIR}/lsan.supp)
88
# Add a new test case for boost tests with working directory in the binary dir root
99
# Params:
1010
# NAME <name>
11+
# COST <cost>, defaults to 10
1112
# LIBS/INCLUDES <value, value, ...>
13+
# CONFIGURATIONS <value, value...>
1214
function(add_testcase)
1315
set(options )
14-
set(oneValueArgs NAME)
16+
set(oneValueArgs NAME COST)
1517
set(multiValueArgs LIBS INCLUDES CONFIGURATIONS)
1618
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
1719
string(MAKE_C_IDENTIFIER "Test_${ARG_NAME}" name)
@@ -20,7 +22,6 @@ function(add_testcase)
2022
target_link_libraries(${name} PRIVATE ${ARG_LIBS}
2123
PRIVATE Boost::unit_test_framework Boost::disable_autolinking
2224
)
23-
get_cmake_property(_variableNames VARIABLES)
2425
target_include_directories(${name} PRIVATE ${ARG_INCLUDES})
2526
# Heuristically guess if we are compiling against dynamic boost
2627
if(NOT Boost_USE_STATIC_LIBS AND Boost_UNIT_TEST_FRAMEWORK_LIBRARY AND NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}\$")
@@ -34,6 +35,10 @@ function(add_testcase)
3435
if(MSVC)
3536
set_property(TARGET ${name} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
3637
endif()
38+
if(NOT DEFINED ARG_COST)
39+
set(ARG_COST 10)
40+
endif()
41+
set_tests_properties(${name} PROPERTIES COST "${ARG_COST}")
3742
if(RTTR_ENABLE_SANITIZERS)
3843
set(options
3944
ASAN_OPTIONS=detect_odr_violation=0

0 commit comments

Comments
 (0)