Skip to content

Commit 44faec3

Browse files
committed
Allow to skip tests
1 parent 3dd1de6 commit 44faec3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
include(platforms.cmake)
22

33
function(arduino_cli_toolchain_add_test NAME)
4+
cmake_parse_arguments(_TEST "" "" "SKIP" ${ARGN})
5+
46
add_custom_target("${NAME}" SOURCES "${NAME}/CMakeLists.txt" "${NAME}/${NAME}.ino")
57

68
foreach(_board_name IN LISTS ARDUINO_CLI_TOOLCHAIN_TESTED_BOARDS)
79
string(REPLACE ":" ";" _board_name_components "${_board_name}")
810
list(GET _board_name_components 2 _board_id)
911

12+
if (_board_id IN_LIST _TEST_SKIP) # <------------------------------ skip boards that are known to fail this test
13+
set(_test_disabled YES)
14+
else()
15+
set(_test_disabled NO)
16+
endif()
17+
1018
set(_test_name "${_board_id}/${NAME}")
1119
set(_workdir "${CMAKE_BINARY_DIR}/${_test_name}")
1220

@@ -28,6 +36,7 @@ function(arduino_cli_toolchain_add_test NAME)
2836
set_tests_properties(
2937
"${_test_name}/configure" PROPERTIES
3038
FIXTURES_SETUP "${_test_name}/configure"
39+
DISABLED "${_test_disabled}"
3140
LABELS "${_board_name}")
3241

3342
add_test( # <-------------------------------------------------------- verify that CMake can be run a second time
@@ -43,6 +52,7 @@ function(arduino_cli_toolchain_add_test NAME)
4352
"${_test_name}/reconfigure" PROPERTIES
4453
FIXTURES_REQUIRED "${_test_name}/configure"
4554
FIXTURES_SETUP "${_test_name}/reconfigure"
55+
DISABLED "${_test_disabled}"
4656
LABELS "${_board_name}")
4757

4858
add_test( # <-------------------------------------------------------------- finally build the Sketch using CMake
@@ -53,6 +63,7 @@ function(arduino_cli_toolchain_add_test NAME)
5363
set_tests_properties(
5464
"${_test_name}/build" PROPERTIES
5565
FIXTURES_REQUIRED "${_test_name}/reconfigure"
66+
DISABLED "${_test_disabled}"
5667
LABELS "${_board_name}")
5768
endforeach()
5869
endfunction()

0 commit comments

Comments
 (0)