Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,26 @@ if (PICO_ON_DEVICE)
add_subdirectory(pico_sha256_test)
add_subdirectory(pico_async_context_test)
endif()

# PICO_TEST_FILE_GENERATOR: Path to the a CMake script to generate test files for ci
if (DEFINED ENV{PICO_TEST_FILE_GENERATOR} AND NOT PICO_TEST_FILE_GENERATOR)
set(PICO_TEST_FILE_GENERATOR $ENV{PICO_TEST_FILE_GENERATOR})
message("Using PICO_TEST_FILE_GENERATOR from environment ('${PICO_TEST_FILE_GENERATOR}')")
endif()

if (PICO_TEST_FILE_GENERATOR AND EXISTS ${PICO_TEST_FILE_GENERATOR})
# Include script file to generate test files for ci
# This can use the following extra target properties from the test targets:
# - PICO_TEST_TIMEOUT: Timeout in seconds for the test (default is 5)
# Maximum time the test is allowed to run for
# - PICO_TEST_SUCCESS_STRING: Success string for the test (default is "PASSED")
# If this string is printed by the test, the test is considered successful
# - PICO_TEST_FAILURE_STRING: Failure string for the test (default is "FAILURE_STRING")
# Can be used to force failure even when the test prints the success string
# - PICO_TEST_BUDDY_FILE: File to run on buddy device for the test (default is NONE)
# For example, low power dormant tests on RP2040 require rtc_clksrc running on the buddy device
# This can either be a path relative to the test target, or an absolute path
# - PICO_TEST_SKIP_IN_CI: Whether to skip the test in ci (default is FALSE)
# If TRUE, the test is not included in the ci test suite
include(${PICO_TEST_FILE_GENERATOR})
endif()
1 change: 1 addition & 0 deletions test/kitchen_sink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ add_executable(kitchen_sink_printf_none ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink.c
target_link_libraries(kitchen_sink_printf_none kitchen_sink_libs kitchen_sink_options)
pico_add_extra_outputs(kitchen_sink_printf_none)
pico_set_printf_implementation(kitchen_sink_printf_none none)
set_target_properties(kitchen_sink_printf_none PROPERTIES PICO_TEST_SUCCESS_STRING "printf support is disabled")

if (NOT KITCHEN_SINK_NO_BINARY_TYPE_VARIANTS)
add_executable(kitchen_sink_copy_to_ram ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink.c)
Expand Down
5 changes: 4 additions & 1 deletion test/pico_divider_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ if (PICO_ON_DEVICE)
add_executable(pico_divider_test
pico_divider_test.c
)

# Skip this test in ci as it never finishes - it ends in an infinite loop in test_random()
set_target_properties(pico_divider_test PROPERTIES PICO_TEST_SKIP_IN_CI TRUE)
target_link_libraries(pico_divider_test pico_stdlib)

if (PICO_RP2040)
Expand All @@ -30,13 +31,15 @@ if (PICO_ON_DEVICE)
target_link_libraries(pico_divider_nesting_test_core INTERFACE pico_stdlib hardware_dma)

add_executable(pico_divider_nesting_test_with_dirty_check)
set_target_properties(pico_divider_nesting_test_with_dirty_check PROPERTIES PICO_TEST_TIMEOUT "15")
target_link_libraries(pico_divider_nesting_test_with_dirty_check pico_divider_nesting_test_core)
if (PICO_RP2040)
pico_set_divider_implementation(pico_divider_nesting_test_with_dirty_check hardware)
endif()
pico_add_extra_outputs(pico_divider_nesting_test_with_dirty_check)

add_executable(pico_divider_nesting_test_with_disable_irq)
set_target_properties(pico_divider_nesting_test_with_disable_irq PROPERTIES PICO_TEST_TIMEOUT "15")
target_link_libraries(pico_divider_nesting_test_with_disable_irq pico_divider_nesting_test_core)
target_compile_definitions(pico_divider_nesting_test_with_disable_irq PRIVATE
PICO_DIVIDER_DISABLE_INTERRUPTS=1)
Expand Down
3 changes: 2 additions & 1 deletion test/pico_float_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (PICO_RISCV)
target_link_libraries(pico_float_test PRIVATE pico_float pico_stdlib)
target_include_directories(pico_float_test PRIVATE ${CMAKE_CURRENT_LIST_DIR})
pico_add_extra_outputs(pico_float_test)
set_target_properties(pico_float_test PROPERTIES PICO_TEST_SUCCESS_STRING "Well done, you can relax now")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we should just change the string to PASSED


# pico_enable_stdio_usb(pico_float_test 1)
# pico_enable_stdio_uart(pico_float_test 0)
Expand Down Expand Up @@ -138,7 +139,7 @@ if (PICO_RP2350 AND NOT PICO_RISCV)
add_executable(m33
m33.c
)

set_target_properties(m33 PROPERTIES PICO_TEST_SUCCESS_STRING "Pass")
target_compile_definitions(m33 PRIVATE
PICO_USE_CRT_PRINTF=1 # want full precision output
PICO_FLOAT_PROPAGATE_NANS=1
Expand Down
2 changes: 1 addition & 1 deletion test/pico_stdlib_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_executable(pico_stdlib_test pico_stdlib_test.c)

set_target_properties(pico_stdlib_test PROPERTIES PICO_TEST_TIMEOUT "15")
target_compile_definitions(pico_stdlib_test PRIVATE
#PICO_ENTER_USB_BOOT_ON_EXIT=1
)
Expand Down
1 change: 1 addition & 0 deletions test/pico_time_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
if (NOT PICO_TIME_NO_ALARM_SUPPORT)
add_executable(pico_time_test pico_time_test.c)
set_target_properties(pico_time_test PROPERTIES PICO_TEST_TIMEOUT "20")
target_compile_definitions(pico_time_test PRIVATE
PICO_TIME_DEFAULT_ALARM_POOL_MAX_TIMERS=250
)
Expand Down
Loading