Skip to content

Add PICO_TEST_FILE_GENERATOR and PICO_TEST_ target properties#2909

Open
will-v-pi wants to merge 2 commits intodevelopfrom
develop-hwtests
Open

Add PICO_TEST_FILE_GENERATOR and PICO_TEST_ target properties#2909
will-v-pi wants to merge 2 commits intodevelopfrom
develop-hwtests

Conversation

@will-v-pi
Copy link
Copy Markdown
Contributor

Add PICO_TEST_FILE_GENERATOR option, along with PICO_TEST_ target properties to aid in generation of lists of tests for running in CI.

This allows pointing to a script file with -DPICO_TEST_FILE_GENERATOR=/path/to/my_test_generator.cmake, and that script file can generate JSON (or whatever format you want) listing whatever the CI runner needs to know.

The PICO_TEST_ target properties help that generator understand what certain tests do, such as what string they print on success (PICO_TEST_SUCCESS_STRING) or how long they are expected to take (PICO_TEST_TIMEOUT). The script file can also access the usual target properties such as PICO_TARGET_STDIO_USB or PICO_TARGET_BINARY_TYPE if it needs that information, so those don't need to be added as separate PICO_TEST_ properties.

This should not affect normal SDK builds, as the file is only included when it is specified as an environment variable or on the command line. I haven't added a PICO_CMAKE_CONFIG for it as I don't think it should be documented in the SDK PDF, as this is primarily for internal use.

@will-v-pi will-v-pi requested a review from kilograham April 24, 2026 17:20
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants