Add PICO_TEST_FILE_GENERATOR and PICO_TEST_ target properties#2909
Open
Add PICO_TEST_FILE_GENERATOR and PICO_TEST_ target properties#2909
Conversation
…in generation of ci test lists
kilograham
reviewed
Apr 24, 2026
| 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") |
Contributor
There was a problem hiding this comment.
seems like we should just change the string to PASSED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
PICO_TEST_FILE_GENERATORoption, along withPICO_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 asPICO_TARGET_STDIO_USBorPICO_TARGET_BINARY_TYPEif it needs that information, so those don't need to be added as separatePICO_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_CONFIGfor it as I don't think it should be documented in the SDK PDF, as this is primarily for internal use.