diff --git a/common/.pages b/common/.pages index f1ecfc71f96b6..602ca5507c5c4 100644 --- a/common/.pages +++ b/common/.pages @@ -3,6 +3,7 @@ nav: - 'Testing Libraries': - 'autoware_testing': common/autoware_testing/design/autoware_testing-design - 'fake_test_node': common/fake_test_node/design/fake_test_node-design + - 'Test Utils': common/test_utils - 'Common Libraries': - 'autoware_auto_common': - 'comparisons': common/autoware_auto_common/design/comparisons diff --git a/planning/planning_test_utils/CMakeLists.txt b/common/test_utils/CMakeLists.txt similarity index 81% rename from planning/planning_test_utils/CMakeLists.txt rename to common/test_utils/CMakeLists.txt index ce746352bb89c..b6d67ac7c324d 100644 --- a/planning/planning_test_utils/CMakeLists.txt +++ b/common/test_utils/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required(VERSION 3.14) -project(planning_test_utils) +project(test_utils) find_package(autoware_cmake REQUIRED) autoware_package() -ament_auto_add_library(planning_test_utils SHARED - src/planning_test_utils.cpp) +ament_auto_add_library(test_utils SHARED + src/test_utils.cpp) ament_auto_add_library(mock_data_parser SHARED src/mock_data_parser.cpp) diff --git a/planning/planning_test_utils/README.md b/common/test_utils/README.md similarity index 94% rename from planning/planning_test_utils/README.md rename to common/test_utils/README.md index c064e5791a487..4671af1995386 100644 --- a/planning/planning_test_utils/README.md +++ b/common/test_utils/README.md @@ -15,7 +15,7 @@ The objective of the `test_utils` is to develop a unit testing library for the A ## Available Maps -The following maps are available [here](https://github.com/autowarefoundation/autoware.universe/tree/main/planning/planning_test_utils/test_map) +The following maps are available [here](https://github.com/autowarefoundation/autoware.universe/tree/main/planning/test_utils/test_map) ### Common diff --git a/planning/planning_test_utils/config/path_with_lane_id_data.yaml b/common/test_utils/config/path_with_lane_id_data.yaml similarity index 100% rename from planning/planning_test_utils/config/path_with_lane_id_data.yaml rename to common/test_utils/config/path_with_lane_id_data.yaml diff --git a/planning/planning_test_utils/config/test_common.param.yaml b/common/test_utils/config/test_common.param.yaml similarity index 100% rename from planning/planning_test_utils/config/test_common.param.yaml rename to common/test_utils/config/test_common.param.yaml diff --git a/planning/planning_test_utils/config/test_nearest_search.param.yaml b/common/test_utils/config/test_nearest_search.param.yaml similarity index 100% rename from planning/planning_test_utils/config/test_nearest_search.param.yaml rename to common/test_utils/config/test_nearest_search.param.yaml diff --git a/planning/planning_test_utils/config/test_vehicle_info.param.yaml b/common/test_utils/config/test_vehicle_info.param.yaml similarity index 100% rename from planning/planning_test_utils/config/test_vehicle_info.param.yaml rename to common/test_utils/config/test_vehicle_info.param.yaml diff --git a/planning/planning_test_utils/images/2km-test.png b/common/test_utils/images/2km-test.png similarity index 100% rename from planning/planning_test_utils/images/2km-test.png rename to common/test_utils/images/2km-test.png diff --git a/planning/planning_test_utils/images/2km-test.svg b/common/test_utils/images/2km-test.svg similarity index 100% rename from planning/planning_test_utils/images/2km-test.svg rename to common/test_utils/images/2km-test.svg diff --git a/planning/planning_test_utils/images/common.png b/common/test_utils/images/common.png similarity index 100% rename from planning/planning_test_utils/images/common.png rename to common/test_utils/images/common.png diff --git a/planning/planning_test_utils/include/planning_test_utils/mock_data_parser.hpp b/common/test_utils/include/test_utils/mock_data_parser.hpp similarity index 90% rename from planning/planning_test_utils/include/planning_test_utils/mock_data_parser.hpp rename to common/test_utils/include/test_utils/mock_data_parser.hpp index 09d4474dda15d..18a973b67c5f9 100644 --- a/planning/planning_test_utils/include/planning_test_utils/mock_data_parser.hpp +++ b/common/test_utils/include/test_utils/mock_data_parser.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PLANNING_TEST_UTILS__MOCK_DATA_PARSER_HPP_ -#define PLANNING_TEST_UTILS__MOCK_DATA_PARSER_HPP_ +#ifndef TEST_UTILS__MOCK_DATA_PARSER_HPP_ +#define TEST_UTILS__MOCK_DATA_PARSER_HPP_ #include #include @@ -43,4 +43,4 @@ std::vector parse_segments(const YAML::Node & node); LaneletRoute parse_lanelet_route_file(const std::string & filename); } // namespace test_utils -#endif // PLANNING_TEST_UTILS__MOCK_DATA_PARSER_HPP_ +#endif // TEST_UTILS__MOCK_DATA_PARSER_HPP_ diff --git a/planning/planning_test_utils/include/planning_test_utils/planning_test_utils.hpp b/common/test_utils/include/test_utils/test_utils.hpp similarity index 98% rename from planning/planning_test_utils/include/planning_test_utils/planning_test_utils.hpp rename to common/test_utils/include/test_utils/test_utils.hpp index 43c3e029d4437..eb7fa5e951f68 100644 --- a/planning/planning_test_utils/include/planning_test_utils/planning_test_utils.hpp +++ b/common/test_utils/include/test_utils/test_utils.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef PLANNING_TEST_UTILS__PLANNING_TEST_UTILS_HPP_ -#define PLANNING_TEST_UTILS__PLANNING_TEST_UTILS_HPP_ +#ifndef TEST_UTILS__TEST_UTILS_HPP_ +#define TEST_UTILS__TEST_UTILS_HPP_ #include "ament_index_cpp/get_package_share_directory.hpp" #include "rclcpp/rclcpp.hpp" @@ -191,7 +191,7 @@ HADMapBin make_map_bin_msg( * @brief Creates a HADMapBin message using a predefined Lanelet2 map file. * * This function loads a lanelet2_map.osm from the test_map folder in the - * planning_test_utils package, overwrites the centerline with a resolution of 5.0, + * test_utils package, overwrites the centerline with a resolution of 5.0, * and converts the map to a HADMapBin message. * * @return A HADMapBin message containing the map data. @@ -299,7 +299,7 @@ void updateNodeOptions( * @brief Loads a PathWithLaneId message from a YAML file. * * This function loads a PathWithLaneId message from a YAML file located in the - * planning_test_utils package. + * test_utils package. * * @return A PathWithLaneId message containing the loaded data. */ @@ -479,4 +479,4 @@ void publishToTargetNode( } // namespace test_utils -#endif // PLANNING_TEST_UTILS__PLANNING_TEST_UTILS_HPP_ +#endif // TEST_UTILS__TEST_UTILS_HPP_ diff --git a/planning/planning_test_utils/package.xml b/common/test_utils/package.xml similarity index 98% rename from planning/planning_test_utils/package.xml rename to common/test_utils/package.xml index b236a64f48da0..16e64a29d52bb 100644 --- a/planning/planning_test_utils/package.xml +++ b/common/test_utils/package.xml @@ -1,7 +1,7 @@ - planning_test_utils + test_utils 0.1.0 ROS 2 node for testing interface of the nodes in planning module Kyoichi Sugahara diff --git a/planning/planning_test_utils/src/mock_data_parser.cpp b/common/test_utils/src/mock_data_parser.cpp similarity index 95% rename from planning/planning_test_utils/src/mock_data_parser.cpp rename to common/test_utils/src/mock_data_parser.cpp index f9f9a7b0b1594..e9170d1ca0621 100644 --- a/planning/planning_test_utils/src/mock_data_parser.cpp +++ b/common/test_utils/src/mock_data_parser.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "planning_test_utils/mock_data_parser.hpp" +#include "test_utils/mock_data_parser.hpp" #include @@ -85,7 +85,7 @@ LaneletRoute parse_lanelet_route_file(const std::string & filename) lanelet_route.goal_pose = (config["goal_pose"]) ? parse_pose(config["goal_pose"]) : Pose(); lanelet_route.segments = parse_segments(config["segments"]); } catch (const std::exception & e) { - RCLCPP_DEBUG(rclcpp::get_logger("planning_test_utils"), "Exception caught: %s", e.what()); + RCLCPP_DEBUG(rclcpp::get_logger("test_utils"), "Exception caught: %s", e.what()); } return lanelet_route; } diff --git a/planning/planning_test_utils/src/planning_test_utils.cpp b/common/test_utils/src/test_utils.cpp similarity index 95% rename from planning/planning_test_utils/src/planning_test_utils.cpp rename to common/test_utils/src/test_utils.cpp index efed22855cf0f..19967e1ddd7fd 100644 --- a/planning/planning_test_utils/src/planning_test_utils.cpp +++ b/common/test_utils/src/test_utils.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "planning_test_utils/planning_test_utils.hpp" +#include "test_utils/test_utils.hpp" namespace test_utils { @@ -121,9 +121,8 @@ HADMapBin make_map_bin_msg(const std::string & absolute_path, const double cente HADMapBin makeMapBinMsg() { - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); - const auto lanelet2_path = planning_test_utils_dir + "/test_map/lanelet2_map.osm"; + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); + const auto lanelet2_path = test_utils_dir + "/test_map/lanelet2_map.osm"; double center_line_resolution = 5.0; return make_map_bin_msg(lanelet2_path, center_line_resolution); @@ -250,9 +249,8 @@ void updateNodeOptions( PathWithLaneId loadPathWithLaneIdInYaml() { - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); - const auto yaml_path = planning_test_utils_dir + "/config/path_with_lane_id_data.yaml"; + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); + const auto yaml_path = test_utils_dir + "/config/path_with_lane_id_data.yaml"; YAML::Node yaml_node = YAML::LoadFile(yaml_path); PathWithLaneId path_msg; diff --git a/planning/planning_test_utils/test/test_mock_data_parser.cpp b/common/test_utils/test/test_mock_data_parser.cpp similarity index 94% rename from planning/planning_test_utils/test/test_mock_data_parser.cpp rename to common/test_utils/test/test_mock_data_parser.cpp index cda09522d8e6e..d2d18af0507cb 100644 --- a/planning/planning_test_utils/test/test_mock_data_parser.cpp +++ b/common/test_utils/test/test_mock_data_parser.cpp @@ -16,7 +16,7 @@ // Assuming the parseRouteFile function is in 'RouteHandler.h' #include "ament_index_cpp/get_package_share_directory.hpp" -#include "planning_test_utils/mock_data_parser.hpp" +#include "test_utils/mock_data_parser.hpp" namespace test_utils { @@ -94,10 +94,8 @@ TEST(ParseFunctions, CompleteYAMLTest) TEST(ParseFunction, CompleteFromFilename) { - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); - const auto parser_test_route = - planning_test_utils_dir + "/test_data/lanelet_route_parser_test.yaml"; + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); + const auto parser_test_route = test_utils_dir + "/test_data/lanelet_route_parser_test.yaml"; const auto lanelet_route = parse_lanelet_route_file(parser_test_route); EXPECT_DOUBLE_EQ(lanelet_route.start_pose.position.x, 1.0); diff --git a/planning/planning_test_utils/test_data/lanelet_route_parser_test.yaml b/common/test_utils/test_data/lanelet_route_parser_test.yaml similarity index 100% rename from planning/planning_test_utils/test_data/lanelet_route_parser_test.yaml rename to common/test_utils/test_data/lanelet_route_parser_test.yaml diff --git a/planning/planning_test_utils/test_map/2km_test.osm b/common/test_utils/test_map/2km_test.osm similarity index 100% rename from planning/planning_test_utils/test_map/2km_test.osm rename to common/test_utils/test_map/2km_test.osm diff --git a/planning/planning_test_utils/test_map/lanelet2_map.osm b/common/test_utils/test_map/lanelet2_map.osm similarity index 100% rename from planning/planning_test_utils/test_map/lanelet2_map.osm rename to common/test_utils/test_map/lanelet2_map.osm diff --git a/planning/planning_test_utils/test_map/pointcloud_map.pcd b/common/test_utils/test_map/pointcloud_map.pcd similarity index 100% rename from planning/planning_test_utils/test_map/pointcloud_map.pcd rename to common/test_utils/test_map/pointcloud_map.pcd diff --git a/planning/autoware_behavior_path_external_request_lane_change_module/test/test_behavior_path_planner_node_interface.cpp b/planning/autoware_behavior_path_external_request_lane_change_module/test/test_behavior_path_planner_node_interface.cpp index 201d01e9b7fa0..212e32fb8ea84 100644 --- a/planning/autoware_behavior_path_external_request_lane_change_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/autoware_behavior_path_external_request_lane_change_module/test/test_behavior_path_planner_node_interface.cpp @@ -15,15 +15,15 @@ #include "ament_index_cpp/get_package_share_directory.hpp" #include "autoware_planning_test_manager/autoware_planning_test_manager.hpp" #include "behavior_path_planner/behavior_path_planner_node.hpp" -#include "planning_test_utils/planning_test_utils.hpp" +#include "test_utils/test_utils.hpp" #include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using ::behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp b/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp index 06c1bc48cf529..6ec1f674d6b9b 100644 --- a/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp +++ b/planning/autoware_behavior_velocity_planner/test/src/test_node_interface.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include @@ -24,7 +24,7 @@ #include using autoware::behavior_velocity_planner::BehaviorVelocityPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; +using autoware_planning_test_manager::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/autoware_planning_test_manager/README.md b/planning/autoware_planning_test_manager/README.md index b72625be999dd..c4c076bd57203 100644 --- a/planning/autoware_planning_test_manager/README.md +++ b/planning/autoware_planning_test_manager/README.md @@ -29,18 +29,18 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithExceptionTrajectory) rclcpp::init(0, nullptr); // instantiate test_manager with PlanningInterfaceTestManager type - auto test_manager = std::make_shared(); + auto test_manager = std::make_shared(); // get package directories for necessary configuration files - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = + ament_index_cpp::get_package_share_directory("test_utils"); const auto target_node_dir = ament_index_cpp::get_package_share_directory("target_node"); // set arguments to get the config file node_options.arguments( {"--ros-args", "--params-file", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", + test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", planning_validator_dir + "/config/planning_validator.param.yaml"}); // instantiate the TargetNode with node_options diff --git a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp index 82636af20579d..50d5ea5cf06ef 100644 --- a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp +++ b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager.hpp @@ -69,7 +69,7 @@ #include #include -namespace planning_test_utils +namespace autoware_planning_test_manager { using autoware_adapi_v1_msgs::msg::OperationModeState; using autoware_auto_mapping_msgs::msg::HADMapBin; @@ -264,6 +264,6 @@ class PlanningInterfaceTestManager void publishAbnormalPath(rclcpp::Node::SharedPtr target_node, std::string topic_name); }; // class PlanningInterfaceTestManager -} // namespace planning_test_utils +} // namespace autoware_planning_test_manager #endif // AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_HPP_ diff --git a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp index 63474c5e458cd..302e6b96649f6 100644 --- a/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp +++ b/planning/autoware_planning_test_manager/include/autoware_planning_test_manager/autoware_planning_test_manager_utils.hpp @@ -14,8 +14,8 @@ #ifndef AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_ #define AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_ -#include #include +#include #include #include diff --git a/planning/autoware_planning_test_manager/package.xml b/planning/autoware_planning_test_manager/package.xml index e2c00756c2ba4..dc87eb083be16 100644 --- a/planning/autoware_planning_test_manager/package.xml +++ b/planning/autoware_planning_test_manager/package.xml @@ -25,9 +25,9 @@ lanelet2_io motion_utils nav_msgs - planning_test_utils rclcpp route_handler + test_utils tf2_msgs tf2_ros tier4_api_msgs diff --git a/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp b/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp index 9ee162ec02d1f..890613b323076 100644 --- a/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp +++ b/planning/autoware_planning_test_manager/src/autoware_planning_test_manager.cpp @@ -16,10 +16,10 @@ #include #include -#include +#include #include -namespace planning_test_utils +namespace autoware_planning_test_manager { PlanningInterfaceTestManager::PlanningInterfaceTestManager() @@ -455,4 +455,4 @@ int PlanningInterfaceTestManager::getReceivedTopicNum() return count_; } -} // namespace planning_test_utils +} // namespace autoware_planning_test_manager diff --git a/planning/autoware_remaining_distance_time_calculator/package.xml b/planning/autoware_remaining_distance_time_calculator/package.xml index 4f0324b23f299..751df8d8dae16 100644 --- a/planning/autoware_remaining_distance_time_calculator/package.xml +++ b/planning/autoware_remaining_distance_time_calculator/package.xml @@ -17,11 +17,11 @@ lanelet2_extension motion_utils nav_msgs - planning_test_utils rclcpp rclcpp_components route_handler std_msgs + test_utils tier4_autoware_utils tier4_planning_msgs diff --git a/planning/behavior_path_avoidance_by_lane_change_module/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_avoidance_by_lane_change_module/test/test_behavior_path_planner_node_interface.cpp index f66e944cb7cbc..c1572331a2d02 100644 --- a/planning/behavior_path_avoidance_by_lane_change_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_avoidance_by_lane_change_module/test/test_behavior_path_planner_node_interface.cpp @@ -16,15 +16,15 @@ #include #include -#include +#include #include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -44,8 +44,7 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto behavior_path_planner_dir = ament_index_cpp::get_package_share_directory("behavior_path_planner"); const auto behavior_path_lane_change_module_dir = @@ -60,9 +59,9 @@ std::shared_ptr generateNode() test_utils::updateNodeOptions( node_options, - {planning_test_utils_dir + "/config/test_common.param.yaml", - planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", + {test_utils_dir + "/config/test_common.param.yaml", + test_utils_dir + "/config/test_nearest_search.param.yaml", + test_utils_dir + "/config/test_vehicle_info.param.yaml", behavior_path_planner_dir + "/config/behavior_path_planner.param.yaml", behavior_path_planner_dir + "/config/drivable_area_expansion.param.yaml", behavior_path_planner_dir + "/config/scene_module_manager.param.yaml", diff --git a/planning/behavior_path_avoidance_module/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_avoidance_module/test/test_behavior_path_planner_node_interface.cpp index 4ae77249b5d0f..3a9d452c2a208 100644 --- a/planning/behavior_path_avoidance_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_avoidance_module/test/test_behavior_path_planner_node_interface.cpp @@ -16,12 +16,12 @@ #include #include -#include +#include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -41,8 +41,7 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto behavior_path_planner_dir = ament_index_cpp::get_package_share_directory("behavior_path_planner"); @@ -54,9 +53,9 @@ std::shared_ptr generateNode() node_options.parameter_overrides(params); test_utils::updateNodeOptions( - node_options, {planning_test_utils_dir + "/config/test_common.param.yaml", - planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", + node_options, {test_utils_dir + "/config/test_common.param.yaml", + test_utils_dir + "/config/test_nearest_search.param.yaml", + test_utils_dir + "/config/test_vehicle_info.param.yaml", behavior_path_planner_dir + "/config/behavior_path_planner.param.yaml", behavior_path_planner_dir + "/config/drivable_area_expansion.param.yaml", behavior_path_planner_dir + "/config/scene_module_manager.param.yaml", diff --git a/planning/behavior_path_dynamic_avoidance_module/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_dynamic_avoidance_module/test/test_behavior_path_planner_node_interface.cpp index cf38a0b4993fe..25d3336b89707 100644 --- a/planning/behavior_path_dynamic_avoidance_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_dynamic_avoidance_module/test/test_behavior_path_planner_node_interface.cpp @@ -16,12 +16,12 @@ #include #include -#include +#include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -41,8 +41,7 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto behavior_path_planner_dir = ament_index_cpp::get_package_share_directory("behavior_path_planner"); @@ -55,9 +54,9 @@ std::shared_ptr generateNode() test_utils::updateNodeOptions( node_options, - {planning_test_utils_dir + "/config/test_common.param.yaml", - planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", + {test_utils_dir + "/config/test_common.param.yaml", + test_utils_dir + "/config/test_nearest_search.param.yaml", + test_utils_dir + "/config/test_vehicle_info.param.yaml", behavior_path_planner_dir + "/config/behavior_path_planner.param.yaml", behavior_path_planner_dir + "/config/drivable_area_expansion.param.yaml", behavior_path_planner_dir + "/config/scene_module_manager.param.yaml", diff --git a/planning/behavior_path_lane_change_module/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_lane_change_module/test/test_behavior_path_planner_node_interface.cpp index 7b36bf475646b..d2f8bf33d72e3 100644 --- a/planning/behavior_path_lane_change_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_lane_change_module/test/test_behavior_path_planner_node_interface.cpp @@ -15,15 +15,15 @@ #include "ament_index_cpp/get_package_share_directory.hpp" #include "autoware_planning_test_manager/autoware_planning_test_manager.hpp" #include "behavior_path_planner/behavior_path_planner_node.hpp" -#include "planning_test_utils/planning_test_utils.hpp" +#include "test_utils/test_utils.hpp" #include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/behavior_path_planner/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_planner/test/test_behavior_path_planner_node_interface.cpp index f8630a0c61973..6fd8980670799 100644 --- a/planning/behavior_path_planner/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_planner/test/test_behavior_path_planner_node_interface.cpp @@ -16,15 +16,15 @@ #include #include -#include +#include #include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -44,8 +44,7 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto behavior_path_planner_dir = ament_index_cpp::get_package_share_directory("behavior_path_planner"); @@ -56,9 +55,9 @@ std::shared_ptr generateNode() node_options.parameter_overrides(params); test_utils::updateNodeOptions( - node_options, {planning_test_utils_dir + "/config/test_common.param.yaml", - planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", + node_options, {test_utils_dir + "/config/test_common.param.yaml", + test_utils_dir + "/config/test_nearest_search.param.yaml", + test_utils_dir + "/config/test_vehicle_info.param.yaml", behavior_path_planner_dir + "/config/behavior_path_planner.param.yaml", behavior_path_planner_dir + "/config/drivable_area_expansion.param.yaml", behavior_path_planner_dir + "/config/scene_module_manager.param.yaml"}); diff --git a/planning/behavior_path_side_shift_module/test/test_behavior_path_planner_node_interface.cpp b/planning/behavior_path_side_shift_module/test/test_behavior_path_planner_node_interface.cpp index db1f5ee3560b1..752103557b595 100644 --- a/planning/behavior_path_side_shift_module/test/test_behavior_path_planner_node_interface.cpp +++ b/planning/behavior_path_side_shift_module/test/test_behavior_path_planner_node_interface.cpp @@ -16,15 +16,15 @@ #include #include -#include +#include #include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using behavior_path_planner::BehaviorPathPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/freespace_planner/test/test_freespace_planner_node_interface.cpp b/planning/freespace_planner/test/test_freespace_planner_node_interface.cpp index 881ce269a7895..8a0bb1b7b732b 100644 --- a/planning/freespace_planner/test/test_freespace_planner_node_interface.cpp +++ b/planning/freespace_planner/test/test_freespace_planner_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using freespace_planner::FreespacePlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -38,14 +38,12 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto freespace_planner_dir = ament_index_cpp::get_package_share_directory("freespace_planner"); node_options.arguments( - {"--ros-args", "--params-file", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", - freespace_planner_dir + "/config/freespace_planner.param.yaml"}); + {"--ros-args", "--params-file", test_utils_dir + "/config/test_vehicle_info.param.yaml", + "--params-file", freespace_planner_dir + "/config/freespace_planner.param.yaml"}); return std::make_shared(node_options); } diff --git a/planning/motion_velocity_smoother/test/test_motion_velocity_smoother_node_interface.cpp b/planning/motion_velocity_smoother/test/test_motion_velocity_smoother_node_interface.cpp index 56813a37941a6..61c2b5a15da43 100644 --- a/planning/motion_velocity_smoother/test/test_motion_velocity_smoother_node_interface.cpp +++ b/planning/motion_velocity_smoother/test/test_motion_velocity_smoother_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using motion_velocity_smoother::MotionVelocitySmootherNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/obstacle_avoidance_planner/test/test_obstacle_avoidance_planner_node_interface.cpp b/planning/obstacle_avoidance_planner/test/test_obstacle_avoidance_planner_node_interface.cpp index d5af4c7e1180f..4cb0bc57c2a3f 100644 --- a/planning/obstacle_avoidance_planner/test/test_obstacle_avoidance_planner_node_interface.cpp +++ b/planning/obstacle_avoidance_planner/test/test_obstacle_avoidance_planner_node_interface.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include @@ -26,20 +26,19 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithExceptionTrajectory) { rclcpp::init(0, nullptr); - auto test_manager = std::make_shared(); + auto test_manager = + std::make_shared(); auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto obstacle_avoidance_planner_dir = ament_index_cpp::get_package_share_directory("obstacle_avoidance_planner"); node_options.arguments( - {"--ros-args", "--params-file", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", - planning_test_utils_dir + "/config/test_common.param.yaml", "--params-file", - planning_test_utils_dir + "/config/test_nearest_search.param.yaml", "--params-file", + {"--ros-args", "--params-file", test_utils_dir + "/config/test_vehicle_info.param.yaml", + "--params-file", test_utils_dir + "/config/test_common.param.yaml", "--params-file", + test_utils_dir + "/config/test_nearest_search.param.yaml", "--params-file", obstacle_avoidance_planner_dir + "/config/obstacle_avoidance_planner.param.yaml"}); auto test_target_node = diff --git a/planning/obstacle_cruise_planner/test/test_obstacle_cruise_planner_node_interface.cpp b/planning/obstacle_cruise_planner/test/test_obstacle_cruise_planner_node_interface.cpp index bd11effb774da..8f1e13639f5b6 100644 --- a/planning/obstacle_cruise_planner/test/test_obstacle_cruise_planner_node_interface.cpp +++ b/planning/obstacle_cruise_planner/test/test_obstacle_cruise_planner_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using motion_planning::ObstacleCruisePlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { diff --git a/planning/obstacle_stop_planner/test/test_obstacle_stop_planner_node_interface.cpp b/planning/obstacle_stop_planner/test/test_obstacle_stop_planner_node_interface.cpp index 4e846d9ff1417..c9cadf66aecc1 100644 --- a/planning/obstacle_stop_planner/test/test_obstacle_stop_planner_node_interface.cpp +++ b/planning/obstacle_stop_planner/test/test_obstacle_stop_planner_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using motion_planning::ObstacleStopPlannerNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -38,18 +38,17 @@ std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto obstacle_stop_planner_dir = ament_index_cpp::get_package_share_directory("obstacle_stop_planner"); node_options.append_parameter_override("enable_slow_down", false); node_options.arguments( - {"--ros-args", "--params-file", planning_test_utils_dir + "/config/test_common.param.yaml", - "--params-file", planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - "--params-file", planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", - "--params-file", obstacle_stop_planner_dir + "/config/common.param.yaml", "--params-file", + {"--ros-args", "--params-file", test_utils_dir + "/config/test_common.param.yaml", + "--params-file", test_utils_dir + "/config/test_nearest_search.param.yaml", "--params-file", + test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", + obstacle_stop_planner_dir + "/config/common.param.yaml", "--params-file", obstacle_stop_planner_dir + "/config/adaptive_cruise_control.param.yaml", "--params-file", obstacle_stop_planner_dir + "/config/obstacle_stop_planner.param.yaml"}); diff --git a/planning/obstacle_velocity_limiter/test/test_obstacle_velocity_limiter_node_interface.cpp b/planning/obstacle_velocity_limiter/test/test_obstacle_velocity_limiter_node_interface.cpp index fb7f9bb85e2c5..a6664c7d41615 100644 --- a/planning/obstacle_velocity_limiter/test/test_obstacle_velocity_limiter_node_interface.cpp +++ b/planning/obstacle_velocity_limiter/test/test_obstacle_velocity_limiter_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include +using autoware_planning_test_manager::PlanningInterfaceTestManager; using obstacle_velocity_limiter::ObstacleVelocityLimiterNode; -using planning_test_utils::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() { @@ -38,15 +38,14 @@ std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto obstacle_velocity_limiter_dir = ament_index_cpp::get_package_share_directory("obstacle_velocity_limiter"); node_options.arguments( - {"--ros-args", "--params-file", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", + {"--ros-args", "--params-file", test_utils_dir + "/config/test_vehicle_info.param.yaml", + "--params-file", obstacle_velocity_limiter_dir + "/config/default_obstacle_velocity_limiter.param.yaml"}); return std::make_shared(node_options); diff --git a/planning/path_smoother/test/test_path_smoother_node_interface.cpp b/planning/path_smoother/test/test_path_smoother_node_interface.cpp index 30e9fba1433cb..08592165f674f 100644 --- a/planning/path_smoother/test/test_path_smoother_node_interface.cpp +++ b/planning/path_smoother/test/test_path_smoother_node_interface.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include @@ -26,18 +26,18 @@ TEST(PlanningModuleInterfaceTest, NodeTestWithExceptionTrajectory) { rclcpp::init(0, nullptr); - auto test_manager = std::make_shared(); + auto test_manager = + std::make_shared(); auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto path_smoothing_dir = ament_index_cpp::get_package_share_directory("path_smoother"); node_options.arguments( - {"--ros-args", "--params-file", planning_test_utils_dir + "/config/test_common.param.yaml", - "--params-file", planning_test_utils_dir + "/config/test_nearest_search.param.yaml", - "--params-file", path_smoothing_dir + "/config/elastic_band_smoother.param.yaml"}); + {"--ros-args", "--params-file", test_utils_dir + "/config/test_common.param.yaml", + "--params-file", test_utils_dir + "/config/test_nearest_search.param.yaml", "--params-file", + path_smoothing_dir + "/config/elastic_band_smoother.param.yaml"}); auto test_target_node = std::make_shared(node_options); diff --git a/planning/planning_validator/test/src/test_planning_validator_node_interface.cpp b/planning/planning_validator/test/src/test_planning_validator_node_interface.cpp index 2b2a32bf54618..3f8ee6f3de26d 100644 --- a/planning/planning_validator/test/src/test_planning_validator_node_interface.cpp +++ b/planning/planning_validator/test/src/test_planning_validator_node_interface.cpp @@ -16,18 +16,19 @@ #include #include -#include +#include #include #include -using planning_test_utils::PlanningInterfaceTestManager; +using autoware_planning_test_manager::PlanningInterfaceTestManager; using planning_validator::PlanningValidator; std::shared_ptr generateTestManager() { - auto test_manager = std::make_shared(); + auto test_manager = + std::make_shared(); // set subscriber with topic name: planning_validator → test_node_ test_manager->setTrajectorySubscriber("planning_validator/output/trajectory"); @@ -43,14 +44,12 @@ std::shared_ptr generateTestManager() std::shared_ptr generateNode() { auto node_options = rclcpp::NodeOptions{}; - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); const auto planning_validator_dir = ament_index_cpp::get_package_share_directory("planning_validator"); node_options.arguments( - {"--ros-args", "--params-file", - planning_test_utils_dir + "/config/test_vehicle_info.param.yaml", "--params-file", - planning_validator_dir + "/config/planning_validator.param.yaml"}); + {"--ros-args", "--params-file", test_utils_dir + "/config/test_vehicle_info.param.yaml", + "--params-file", planning_validator_dir + "/config/planning_validator.param.yaml"}); return std::make_shared(node_options); } diff --git a/planning/route_handler/README.md b/planning/route_handler/README.md index e8df4fd087930..0d38be94f02d0 100644 --- a/planning/route_handler/README.md +++ b/planning/route_handler/README.md @@ -4,8 +4,8 @@ ## Unit Testing -The unit testing depends on `planning_test_utils` package. -`planning_test_utils` is a library that provides several common functions to simplify unit test creating. +The unit testing depends on `test_utils` package. +`test_utils` is a library that provides several common functions to simplify unit test creating. ![route_handler_test](./images/route_handler_test.svg) @@ -15,4 +15,4 @@ By default, route file is necessary to create tests. The following illustrates t ![lane_change_test_route](./images/lane_change_test_route.svg) -- The route is based on map that can be obtained from `planning_test_utils\test_map` +- The route is based on map that can be obtained from `test_utils\test_map` diff --git a/planning/route_handler/package.xml b/planning/route_handler/package.xml index 097bc62f8bf39..ef77d4c5b0fc8 100644 --- a/planning/route_handler/package.xml +++ b/planning/route_handler/package.xml @@ -27,9 +27,9 @@ autoware_planning_msgs geometry_msgs lanelet2_extension - planning_test_utils rclcpp rclcpp_components + test_utils tf2_ros tier4_autoware_utils yaml-cpp diff --git a/planning/route_handler/test/test_route_handler.hpp b/planning/route_handler/test/test_route_handler.hpp index 3c6893da3f9d1..b19418f181846 100644 --- a/planning/route_handler/test/test_route_handler.hpp +++ b/planning/route_handler/test/test_route_handler.hpp @@ -17,8 +17,8 @@ #include "ament_index_cpp/get_package_share_directory.hpp" #include "gtest/gtest.h" -#include "planning_test_utils/mock_data_parser.hpp" -#include "planning_test_utils/planning_test_utils.hpp" +#include "test_utils/mock_data_parser.hpp" +#include "test_utils/test_utils.hpp" #include #include @@ -44,9 +44,8 @@ class TestRouteHandler : public ::testing::Test public: TestRouteHandler() { - const auto planning_test_utils_dir = - ament_index_cpp::get_package_share_directory("planning_test_utils"); - const auto lanelet2_path = planning_test_utils_dir + "/test_map/2km_test.osm"; + const auto test_utils_dir = ament_index_cpp::get_package_share_directory("test_utils"); + const auto lanelet2_path = test_utils_dir + "/test_map/2km_test.osm"; constexpr double center_line_resolution = 5.0; const auto map_bin_msg = test_utils::make_map_bin_msg(lanelet2_path, center_line_resolution); route_handler_ = std::make_shared(map_bin_msg); diff --git a/planning/scenario_selector/test/test_scenario_selector_node_interface.cpp b/planning/scenario_selector/test/test_scenario_selector_node_interface.cpp index 90995e4e2ae72..c0a9c24270e54 100644 --- a/planning/scenario_selector/test/test_scenario_selector_node_interface.cpp +++ b/planning/scenario_selector/test/test_scenario_selector_node_interface.cpp @@ -16,14 +16,14 @@ #include #include -#include +#include #include #include #include -using planning_test_utils::PlanningInterfaceTestManager; +using autoware_planning_test_manager::PlanningInterfaceTestManager; std::shared_ptr generateTestManager() {