cmake: unittest: add -t run
support
Add support to run unit tests directly from `west build`, for environments where `west build -t run-test` (which runs the binary under valgrind) is inappropriate or unavailable (WSL). `west build -t run` also has the muscle-memory advantage of being the same target name as the `native_sim` boards. Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
parent
03eb4791a4
commit
1556596def
1 changed files with 7 additions and 0 deletions
|
@ -162,6 +162,13 @@ if(VALGRIND_PROGRAM)
|
|||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(run
|
||||
COMMAND
|
||||
$<TARGET_FILE:testbinary>
|
||||
DEPENDS testbinary
|
||||
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(run-test
|
||||
COMMAND
|
||||
${VALGRIND} ${VALGRIND_FLAGS}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue