diff --git a/boards/emlid/navio2/cross.cmake b/boards/emlid/navio2/cross.cmake index 21b0587846..d5e1cc038f 100644 --- a/boards/emlid/navio2/cross.cmake +++ b/boards/emlid/navio2/cross.cmake @@ -85,6 +85,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/emlid/navio2/native.cmake b/boards/emlid/navio2/native.cmake index d7fe1c66ad..23b11f1d5f 100644 --- a/boards/emlid/navio2/native.cmake +++ b/boards/emlid/navio2/native.cmake @@ -83,6 +83,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/px4/raspberrypi/cross.cmake b/boards/px4/raspberrypi/cross.cmake index 15d75d0760..c37217e6c6 100644 --- a/boards/px4/raspberrypi/cross.cmake +++ b/boards/px4/raspberrypi/cross.cmake @@ -5,7 +5,7 @@ px4_add_board( LABEL cross PLATFORM posix ARCHITECTURE cortex-a53 - TOOLCHAIN Toolchain-arm-linux-gnueabihf + TOOLCHAIN arm-linux-gnueabihf TESTING DRIVERS @@ -64,6 +64,7 @@ px4_add_board( pwm reboot sd_bench + shutdown tests # tests and test runner top topic_listener @@ -72,6 +73,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/px4/raspberrypi/native.cmake b/boards/px4/raspberrypi/native.cmake index 01257d2a9d..80a714db6c 100644 --- a/boards/px4/raspberrypi/native.cmake +++ b/boards/px4/raspberrypi/native.cmake @@ -47,6 +47,7 @@ px4_add_board( navigator position_estimator_inav sensors + #simulator #uavcan vtol_att_control wind_estimator @@ -62,6 +63,7 @@ px4_add_board( pwm reboot sd_bench + shutdown tests # tests and test runner top topic_listener @@ -70,6 +72,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/px4/sitl/default.cmake b/boards/px4/sitl/default.cmake index 184a8c00ea..b960ccce8f 100644 --- a/boards/px4/sitl/default.cmake +++ b/boards/px4/sitl/default.cmake @@ -73,6 +73,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/px4/sitl/rtps.cmake b/boards/px4/sitl/rtps.cmake index 9be0cde875..fae8d89331 100644 --- a/boards/px4/sitl/rtps.cmake +++ b/boards/px4/sitl/rtps.cmake @@ -75,6 +75,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/boards/px4/sitl/test.cmake b/boards/px4/sitl/test.cmake index 2c541dfee9..3dcb200120 100644 --- a/boards/px4/sitl/test.cmake +++ b/boards/px4/sitl/test.cmake @@ -73,6 +73,7 @@ px4_add_board( EXAMPLES bottle_drop # OBC challenge + dyn_hello # dynamically loading modules example fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control hello #hwtest # Hardware test diff --git a/platforms/posix/cmake/sitl_tests.cmake b/platforms/posix/cmake/sitl_tests.cmake index 11cca7cf1a..4d1f599070 100644 --- a/platforms/posix/cmake/sitl_tests.cmake +++ b/platforms/posix/cmake/sitl_tests.cmake @@ -100,18 +100,18 @@ set_tests_properties(shutdown PROPERTIES PASS_REGULAR_EXPRESSION "Shutting down" sanitizer_fail_test_on_error(shutdown) # Dynamic module loading test -#add_test(NAME dyn -# COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh -# $ -# none -# none -# test_dyn_hello -# ${PX4_SOURCE_DIR} -# ${PX4_BINARY_DIR} -# $ -# WORKING_DIRECTORY ${SITL_WORKING_DIR}) -#set_tests_properties(dyn PROPERTIES PASS_REGULAR_EXPRESSION "1: PASSED") -#sanitizer_fail_test_on_error(dyn) +add_test(NAME dyn + COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh + $ + none + none + test_dyn_hello + ${PX4_SOURCE_DIR} + ${PX4_BINARY_DIR} + $ + WORKING_DIRECTORY ${SITL_WORKING_DIR}) +set_tests_properties(dyn PROPERTIES PASS_REGULAR_EXPRESSION "1: PASSED") +sanitizer_fail_test_on_error(dyn) # run arbitrary commands set(test_cmds @@ -140,7 +140,9 @@ endforeach() add_custom_target(test_results COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test - DEPENDS px4 #platforms__posix__tests__dyn_hello + DEPENDS + px4 + examples__dyn_hello USES_TERMINAL COMMENT "Running tests in sitl" WORKING_DIRECTORY ${PX4_BINARY_DIR}) diff --git a/posix-configs/SITL/init/test/test_dyn_hello b/posix-configs/SITL/init/test/test_dyn_hello index e323fa95c2..a97ff51d60 100644 --- a/posix-configs/SITL/init/test/test_dyn_hello +++ b/posix-configs/SITL/init/test/test_dyn_hello @@ -3,6 +3,6 @@ # (px4-alias.sh is expected to be in the PATH) . px4-alias.sh -dyn ./platforms__posix__tests__dyn_hello.px4mod PASSED +dyn ./examples__dyn_hello.px4mod PASSED shutdown diff --git a/src/examples/dyn_hello/CMakeLists.txt b/src/examples/dyn_hello/CMakeLists.txt new file mode 100644 index 0000000000..99c47bdafd --- /dev/null +++ b/src/examples/dyn_hello/CMakeLists.txt @@ -0,0 +1,41 @@ +############################################################################ +# +# Copyright (c) 2018 PX4 Development Team. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name PX4 nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +px4_add_module( + MODULE examples__dyn_hello + MAIN hello + SRCS + hello.cpp + DEPENDS + DYNAMIC + ) diff --git a/src/platforms/posix/tests/dyn_hello/hello.cpp b/src/examples/dyn_hello/hello.cpp similarity index 100% rename from src/platforms/posix/tests/dyn_hello/hello.cpp rename to src/examples/dyn_hello/hello.cpp diff --git a/src/platforms/posix/tests/dyn_hello/CMakeLists.txt b/src/platforms/posix/tests/dyn_hello/CMakeLists.txt deleted file mode 100644 index fd1577b8db..0000000000 --- a/src/platforms/posix/tests/dyn_hello/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -px4_add_module( - MODULE platforms__posix__tests__dyn_hello - MAIN hello - SRCS - hello.cpp - DEPENDS - DYNAMIC - )