-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathAddTestHelpers.cmake
39 lines (29 loc) · 1.19 KB
/
AddTestHelpers.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function(setup_test_common)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAME;COST;TIMEOUT" "COMMAND")
add_test(NAME "${arg_NAME}" COMMAND ${arg_COMMAND} WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
if(arg_COST)
set_tests_properties("${arg_NAME}" PROPERTIES COST ${arg_COST})
endif()
if(arg_TIMEOUT)
set_tests_properties("${arg_NAME}" PROPERTIES TIMEOUT ${arg_TIMEOUT})
endif()
endfunction()
function(add_p_test)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAME;COST;TIMEOUT" "COMMAND")
setup_test_common(${ARGV})
endfunction()
function(add_wasmspec_test)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAME;COST;TIMEOUT" "COMMAND")
setup_test_common(${ARGV})
set_property(TEST "${arg_NAME}" PROPERTY LABELS wasm_spec_tests)
endfunction()
function(add_np_test)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAME;COST;TIMEOUT" "COMMAND")
setup_test_common(${ARGV})
set_property(TEST "${arg_NAME}" PROPERTY LABELS nonparallelizable_tests)
endfunction()
function(add_lr_test)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "NAME;COST;TIMEOUT" "COMMAND")
setup_test_common(${ARGV})
set_property(TEST "${arg_NAME}" PROPERTY LABELS long_running_tests)
endfunction()