Browse Source

sitl tests manually list all

sbg
Daniel Agar 8 years ago committed by Lorenz Meier
parent
commit
d6fd633500
  1. 3
      Makefile
  2. 54
      src/firmware/posix/CMakeLists.txt

3
Makefile

@ -281,7 +281,8 @@ unittest: posix_sitl_default @@ -281,7 +281,8 @@ unittest: posix_sitl_default
run_tests_posix:
@$(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:
@$(call PX4_RUN,$(MAKE) --no-print-directory tests PX4_CODE_COVERAGE=1 CCACHE_DISABLE=1)

54
src/firmware/posix/CMakeLists.txt

@ -141,45 +141,42 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/posix-configs DESTINATION ${CMAKE_INSTAL @@ -141,45 +141,42 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/posix-configs DESTINATION ${CMAKE_INSTAL
# tests
#
file(GLOB test_src_files
RELATIVE
${PX4_SOURCE_DIR}/src/systemcmds/tests/
${PX4_SOURCE_DIR}/src/systemcmds/tests/test_*.c*)
#T ODO: 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
uart_send
set(tests
autodeclination
bson
commander
controllib
conv
file2
float
gpio
hrt
hysteresis
int
mathlib
matrix
mc_pos_control
mixer
param
perf
rc
servo
sf0x
sleep
uorb
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND tests_exclude
list(REMOVE_ITEM tests
hysteresis
mixer
)
endif()
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})
foreach(test_name ${tests})
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>
@ -192,7 +189,6 @@ foreach(test_name ${test_src_files}) @@ -192,7 +189,6 @@ foreach(test_name ${test_src_files})
WORKING_DIRECTORY ${SITL_WORKING_DIR})
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
endif()
endforeach()
add_custom_target(test_results

Loading…
Cancel
Save