You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
973 B
24 lines
973 B
5 years ago
|
function(setup_resource_tests)
|
||
|
if(CTEST_RESOURCE_ALLOC_ENABLED)
|
||
4 years ago
|
add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E rm -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
|
||
5 years ago
|
endif()
|
||
|
endfunction()
|
||
|
|
||
|
function(add_resource_test name sleep_time proc)
|
||
|
if(CTEST_RESOURCE_ALLOC_ENABLED)
|
||
|
add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}" "${proc}")
|
||
|
set_property(TEST "${name}" PROPERTY DEPENDS ResourceSetup)
|
||
|
else()
|
||
|
add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}")
|
||
|
endif()
|
||
|
set_property(TEST "${name}" PROPERTY RESOURCE_GROUPS "${proc}")
|
||
|
list(APPEND RESOURCE_TESTS "${name}")
|
||
|
set(RESOURCE_TESTS "${RESOURCE_TESTS}" PARENT_SCOPE)
|
||
|
endfunction()
|
||
|
|
||
|
function(cleanup_resource_tests)
|
||
|
if(CTEST_RESOURCE_ALLOC_ENABLED)
|
||
|
file(WRITE "${CMAKE_BINARY_DIR}/restests.txt" "${RESOURCE_TESTS}")
|
||
|
endif()
|
||
|
endfunction()
|