add test file for px4controller
This commit is contained in:
@@ -66,8 +66,7 @@ class FailsafeUnitTest(unittest.TestCase):
|
|||||||
request.message = "test"
|
request.message = "test"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
end_time = time.time() + 10.0
|
while True:
|
||||||
while time.time() < end_time:
|
|
||||||
rclpy.spin_once(self.node, timeout_sec=0.1)
|
rclpy.spin_once(self.node, timeout_sec=0.1)
|
||||||
if (not self.service_called):
|
if (not self.service_called):
|
||||||
future = failsafe_client.call_async(request)
|
future = failsafe_client.call_async(request)
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ install(
|
|||||||
DESTINATION share/${PROJECT_NAME}
|
DESTINATION share/${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install(FILES
|
||||||
|
test/test_failsafe_enabled.py
|
||||||
|
DESTINATION lib/${PROJECT_NAME})
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
find_package(ament_lint_auto REQUIRED)
|
find_package(ament_lint_auto REQUIRED)
|
||||||
|
|
||||||
@@ -70,6 +74,8 @@ if(BUILD_TESTING)
|
|||||||
# uncomment the line when this package is not in a git repo
|
# uncomment the line when this package is not in a git repo
|
||||||
# set(ament_cmake_cpplint_FOUND TRUE)
|
# set(ament_cmake_cpplint_FOUND TRUE)
|
||||||
ament_lint_auto_find_test_dependencies()
|
ament_lint_auto_find_test_dependencies()
|
||||||
|
find_package(launch_testing_ament_cmake REQUIRED)
|
||||||
|
add_launch_test(test/test_failsafe_enabled.py)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ament_package()
|
ament_package()
|
||||||
|
|||||||
0
src/px4_connection/test/test_failsafe_enabled.py
Normal file
0
src/px4_connection/test/test_failsafe_enabled.py
Normal file
Reference in New Issue
Block a user