split tests for SITL ctest

This commit is contained in:
Daniel Agar
2017-01-02 10:14:41 +01:00
committed by Lorenz Meier
parent cbc9680800
commit 74231e6656
9 changed files with 83 additions and 21 deletions
+45 -12
View File
@@ -141,17 +141,50 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/posix-configs DESTINATION ${CMAKE_INSTAL
# tests
#
add_test(NAME rcS_tests
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
$<TARGET_FILE:px4>
posix-configs/SITL/init/test
none
none
none
${PX4_SOURCE_DIR}
${PX4_BINARY_DIR}
WORKING_DIRECTORY ${SITL_WORKING_DIR})
set_tests_properties(rcS_tests PROPERTIES
PASS_REGULAR_EXPRESSION "All tests passed")
file(GLOB test_src_files
RELATIVE
${PX4_SOURCE_DIR}/src/systemcmds/tests/
${PX4_SOURCE_DIR}/src/systemcmds/tests/test_*.c*)
#TODO: find a way to keep this in sync with tests_main
set(tests_exclude
adc
dataman
file
hott_telemetry
jig_voltages
led
mount
ppm_loopback
sensors
time
uart_baudchange
uart_break
uart_console
uart_loopback
)
foreach(test_name ${test_src_files})
string(REPLACE "test_" "" test_name ${test_name})
string(REPLACE ".cpp" "" test_name ${test_name})
string(REPLACE ".c" "" test_name ${test_name})
configure_file(${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_template.in ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/${test_name}_generated)
list(FIND tests_exclude ${test_name} _index)
if (${_index} EQUAL -1)
add_test(NAME ${test_name}
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
$<TARGET_FILE:px4>
posix-configs/SITL/init/test/
none
none
${test_name}_generated
${PX4_SOURCE_DIR}
${PX4_BINARY_DIR}
WORKING_DIRECTORY ${SITL_WORKING_DIR})
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
endif()
endforeach()
# vim: set noet ft=cmake fenc=utf-8 ff=unix :