sitl tests manually list all

This commit is contained in:
Daniel Agar
2017-01-02 10:14:41 +01:00
committed by Lorenz Meier
parent 4f97ef417f
commit d6fd633500
2 changed files with 40 additions and 43 deletions
+2 -1
View File
@@ -281,7 +281,8 @@ unittest: posix_sitl_default
run_tests_posix: run_tests_posix:
@$(call PX4_RUN,$(MAKE) --no-print-directory posix_sitl_default test_results_junit) @$(call PX4_RUN,$(MAKE) --no-print-directory posix_sitl_default test_results_junit)
tests: unittest run_tests_posix tests: run_tests_posix
@$(call PX4_RUN,$(MAKE) --no-print-directory unittest)
tests_coverage: tests_coverage:
@$(call PX4_RUN,$(MAKE) --no-print-directory tests PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1) @$(call PX4_RUN,$(MAKE) --no-print-directory tests PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1)
+38 -42
View File
@@ -141,58 +141,54 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/posix-configs DESTINATION ${CMAKE_INSTAL
# tests # tests
# #
file(GLOB test_src_files #T ODO: find a way to keep this in sync with tests_main
RELATIVE set(tests
${PX4_SOURCE_DIR}/src/systemcmds/tests/ autodeclination
${PX4_SOURCE_DIR}/src/systemcmds/tests/test_*.c*) bson
commander
#TODO: find a way to keep this in sync with tests_main controllib
set(tests_exclude conv
adc file2
dataman float
file gpio
hott_telemetry hrt
jig_voltages hysteresis
led int
mount mathlib
ppm_loopback matrix
sensors mc_pos_control
time mixer
uart_baudchange param
uart_break perf
uart_console rc
uart_loopback servo
uart_send sf0x
sleep
uorb
) )
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND tests_exclude list(REMOVE_ITEM tests
hysteresis hysteresis
mixer mixer
) )
endif() endif()
foreach(test_name ${test_src_files}) foreach(test_name ${tests})
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) 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") add_test(NAME ${test_name}
endif() 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")
endforeach() endforeach()
add_custom_target(test_results add_custom_target(test_results