mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 00:41:36 +08:00
sitl tests manually list all
This commit is contained in:
committed by
Lorenz Meier
parent
4f97ef417f
commit
d6fd633500
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
add_test(NAME ${test_name}
|
||||||
if (${_index} EQUAL -1)
|
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
|
||||||
add_test(NAME ${test_name}
|
$<TARGET_FILE:px4>
|
||||||
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
|
posix-configs/SITL/init/test
|
||||||
$<TARGET_FILE:px4>
|
none
|
||||||
posix-configs/SITL/init/test
|
none
|
||||||
none
|
${test_name}_generated
|
||||||
none
|
${PX4_SOURCE_DIR}
|
||||||
${test_name}_generated
|
${PX4_BINARY_DIR}
|
||||||
${PX4_SOURCE_DIR}
|
WORKING_DIRECTORY ${SITL_WORKING_DIR})
|
||||||
${PX4_BINARY_DIR}
|
|
||||||
WORKING_DIRECTORY ${SITL_WORKING_DIR})
|
|
||||||
|
|
||||||
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
|
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(test_results
|
add_custom_target(test_results
|
||||||
|
|||||||
Reference in New Issue
Block a user