Skip to content

Commit

Permalink
Fix scitos2_mira test
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Tudela <ajtudela@gmail.com>
  • Loading branch information
ajtudela committed Apr 8, 2024
1 parent b1c0136 commit 7bb9360
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scitos2_mira/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wshadow -Wnull-dereference)
# add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wshadow -Wnull-dereference)
add_compile_options(-Wall -Wextra)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>")
endif()
Expand Down Expand Up @@ -87,11 +87,16 @@ install(DIRECTORY launch params
DESTINATION share/${PROJECT_NAME}/
)

install(FILES test/scitos_config.xml
DESTINATION share/${PROJECT_NAME}/test
)

# ###########
# Testing ##
# ###########
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)

# the following line skips the linter which checks for copyrights
set(ament_cmake_copyright_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
Expand Down
3 changes: 3 additions & 0 deletions scitos2_mira/test/scitos_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<root>
<link child="RobotFrame" parent="OdometryFrame" />
</root>
9 changes: 9 additions & 0 deletions scitos2_mira/test/test_mira_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "gtest/gtest.h"
#include "rclcpp/rclcpp.hpp"
#include <ament_index_cpp/get_package_share_directory.hpp>
#include "lifecycle_msgs/msg/state.hpp"
#include "nav2_util/node_utils.hpp"
#include "scitos2_mira/mira_framework.hpp"
Expand All @@ -30,6 +31,14 @@ class MiraFrameworkFixture : public scitos2_mira::MiraFramework
TEST(ScitosMiraFrameworkTest, configure) {
// Create the node
auto node = std::make_shared<MiraFrameworkFixture>();

// Set the scitos config parameter. In the the robot this should be a XML file
std::string pkg = ament_index_cpp::get_package_share_directory("scitos2_mira");

nav2_util::declare_parameter_if_not_declared(
node, "scitos_config", rclcpp::ParameterValue(pkg + "/test/scitos_config.xml"));

// Configure the node
node->configure();
node->activate();

Expand Down

0 comments on commit 7bb9360

Please sign in to comment.