diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6e83e2b52fdbe..9ab0d362d4920 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,6 +3,7 @@ common/autoware_adapi_specs/** isamu.takagi@tier4.jp ryohsuke.mitsudome@tier4.jp common/autoware_auto_common/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp common/autoware_component_interface_specs/** isamu.takagi@tier4.jp yukihiro.saito@tier4.jp common/autoware_component_interface_tools/** isamu.takagi@tier4.jp +common/autoware_fake_test_node/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp common/autoware_geography_utils/** koji.minoda@tier4.jp common/autoware_goal_distance_calculator/** taiki.tanaka@tier4.jp common/autoware_grid_map_utils/** maxime.clement@tier4.jp @@ -27,7 +28,6 @@ common/autoware_universe_utils/** mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp common/autoware_vehicle_info_utils/** mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp common/bag_time_manager_rviz_plugin/** taiki.tanaka@tier4.jp common/component_interface_utils/** isamu.takagi@tier4.jp yukihiro.saito@tier4.jp -common/fake_test_node/** opensource@apex.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp common/global_parameter_loader/** ryohsuke.mitsudome@tier4.jp common/glog_component/** takamasa.horibe@tier4.jp common/tier4_adapi_rviz_plugin/** hiroki.ota@tier4.jp isamu.takagi@tier4.jp kosuke.takeuchi@tier4.jp diff --git a/common/.pages b/common/.pages index 64d2223329a10..cd0423fa8de79 100644 --- a/common/.pages +++ b/common/.pages @@ -2,7 +2,7 @@ nav: - 'Introduction': common - 'Testing Libraries': - 'autoware_testing': common/autoware_testing/design/autoware_testing-design - - 'fake_test_node': common/fake_test_node/design/fake_test_node-design + - 'autoware_fake_test_node': common/autoware_fake_test_node/design/fake_test_node-design - 'Test Utils': common/autoware_test_utils - 'Common Libraries': - 'autoware_auto_common': diff --git a/common/fake_test_node/CHANGELOG.rst b/common/autoware_fake_test_node/CHANGELOG.rst similarity index 100% rename from common/fake_test_node/CHANGELOG.rst rename to common/autoware_fake_test_node/CHANGELOG.rst diff --git a/common/fake_test_node/CMakeLists.txt b/common/autoware_fake_test_node/CMakeLists.txt similarity index 51% rename from common/fake_test_node/CMakeLists.txt rename to common/autoware_fake_test_node/CMakeLists.txt index 8ad71df2777f3..1be6cdf51ee00 100644 --- a/common/fake_test_node/CMakeLists.txt +++ b/common/autoware_fake_test_node/CMakeLists.txt @@ -1,17 +1,17 @@ cmake_minimum_required(VERSION 3.14) -project(fake_test_node) +project(autoware_fake_test_node) find_package(autoware_cmake REQUIRED) autoware_package() -ament_auto_add_library(fake_test_node SHARED src/fake_test_node.cpp) +ament_auto_add_library(${PROJECT_NAME} SHARED src/fake_test_node.cpp) if(BUILD_TESTING) ament_add_ros_isolated_gtest(test_fake_test_node test/test_fake_test_node.cpp ) - add_dependencies(test_fake_test_node fake_test_node) - target_link_libraries(test_fake_test_node fake_test_node) + add_dependencies(test_fake_test_node ${PROJECT_NAME}) + target_link_libraries(test_fake_test_node ${PROJECT_NAME}) endif() ament_auto_package() diff --git a/common/fake_test_node/design/fake_test_node-design.md b/common/autoware_fake_test_node/design/fake_test_node-design.md similarity index 91% rename from common/fake_test_node/design/fake_test_node-design.md rename to common/autoware_fake_test_node/design/fake_test_node-design.md index c9c040881664a..34142c3529ea9 100644 --- a/common/fake_test_node/design/fake_test_node-design.md +++ b/common/autoware_fake_test_node/design/fake_test_node-design.md @@ -10,8 +10,8 @@ fixture. This package contains a library that introduces two utility classes that can be used in place of custom fixtures described above to write integration tests for a node: -- `autoware::tools::testing::FakeTestNode` - to use as a custom test fixture with `TEST_F` tests -- `autoware::tools::testing::FakeTestNodeParametrized` - to use a custom test fixture with the +- `autoware::fake_test_node::FakeTestNode` - to use as a custom test fixture with `TEST_F` tests +- `autoware::fake_test_node::FakeTestNodeParametrized` - to use a custom test fixture with the parametrized `TEST_P` tests (accepts a template parameter that gets forwarded to `testing::TestWithParam`) @@ -30,10 +30,10 @@ Let's say there is a node `NodeUnderTest` that requires testing. It just subscribes to `std_msgs::msg::Int32` messages and publishes a `std_msgs::msg::Bool` to indicate that the input is positive. To test such a node the following code can be used utilizing the -`autoware::tools::testing::FakeTestNode`: +`autoware::fake_test_node::FakeTestNode`: ```cpp -using FakeNodeFixture = autoware::tools::testing::FakeTestNode; +using FakeNodeFixture = autoware::fake_test_node::FakeTestNode; /// @test Test that we can use a non-parametrized test. TEST_F(FakeNodeFixture, Test) { diff --git a/common/fake_test_node/include/fake_test_node/fake_test_node.hpp b/common/autoware_fake_test_node/include/autoware/fake_test_node/fake_test_node.hpp similarity index 96% rename from common/fake_test_node/include/fake_test_node/fake_test_node.hpp rename to common/autoware_fake_test_node/include/autoware/fake_test_node/fake_test_node.hpp index 9f7fee89776b3..40d45f0689283 100644 --- a/common/fake_test_node/include/fake_test_node/fake_test_node.hpp +++ b/common/autoware_fake_test_node/include/autoware/fake_test_node/fake_test_node.hpp @@ -17,10 +17,10 @@ /// \copyright Copyright 2021 Apex.AI, Inc. /// All rights reserved. -#ifndef FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ -#define FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ +#ifndef AUTOWARE__FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ +#define AUTOWARE__FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ -#include +#include #include #include @@ -30,11 +30,7 @@ #include #include -namespace autoware -{ -namespace tools -{ -namespace testing +namespace autoware::fake_test_node { /// @@ -237,8 +233,6 @@ class FAKE_TEST_NODE_PUBLIC FakeTestNode : public detail::FakeNodeCore, public : void TearDown() override; }; -} // namespace testing -} // namespace tools -} // namespace autoware +} // namespace autoware::fake_test_node -#endif // FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ +#endif // AUTOWARE__FAKE_TEST_NODE__FAKE_TEST_NODE_HPP_ diff --git a/common/fake_test_node/include/fake_test_node/visibility_control.hpp b/common/autoware_fake_test_node/include/autoware/fake_test_node/visibility_control.hpp similarity index 90% rename from common/fake_test_node/include/fake_test_node/visibility_control.hpp rename to common/autoware_fake_test_node/include/autoware/fake_test_node/visibility_control.hpp index 62e57eef113f1..d21dbfdbcfc75 100644 --- a/common/fake_test_node/include/fake_test_node/visibility_control.hpp +++ b/common/autoware_fake_test_node/include/autoware/fake_test_node/visibility_control.hpp @@ -17,8 +17,8 @@ /// \copyright Copyright 2021 Apex.AI, Inc. /// All rights reserved. -#ifndef FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ -#define FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ +#ifndef AUTOWARE__FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ +#define AUTOWARE__FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ //////////////////////////////////////////////////////////////////////////////// #if defined(__WIN32) @@ -39,4 +39,4 @@ #error "Unsupported Build Configuration" #endif // defined(__WIN32) -#endif // FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ +#endif // AUTOWARE__FAKE_TEST_NODE__VISIBILITY_CONTROL_HPP_ diff --git a/common/fake_test_node/package.xml b/common/autoware_fake_test_node/package.xml similarity index 96% rename from common/fake_test_node/package.xml rename to common/autoware_fake_test_node/package.xml index ac2cf75a52423..413f359eafbcc 100644 --- a/common/fake_test_node/package.xml +++ b/common/autoware_fake_test_node/package.xml @@ -1,7 +1,7 @@ - fake_test_node + autoware_fake_test_node 0.38.0 A fake node that we can use in the integration-like cpp tests. Apex.AI, Inc. diff --git a/common/fake_test_node/src/fake_test_node.cpp b/common/autoware_fake_test_node/src/fake_test_node.cpp similarity index 90% rename from common/fake_test_node/src/fake_test_node.cpp rename to common/autoware_fake_test_node/src/fake_test_node.cpp index 1704d371c3a5e..75714c0dd5b08 100644 --- a/common/fake_test_node/src/fake_test_node.cpp +++ b/common/autoware_fake_test_node/src/fake_test_node.cpp @@ -17,12 +17,12 @@ /// \copyright Copyright 2021 Apex.AI, Inc. /// All rights reserved. -#include +#include #include #include -namespace +namespace autoware::fake_test_node { constexpr auto kSpinThread = false; constexpr auto kArgc = 0; @@ -34,15 +34,6 @@ std::string sanitize_test_name(const std::string & name) return sanitize_test_name; } -} // namespace - -namespace autoware -{ -namespace tools -{ -namespace testing -{ - void detail::FakeNodeCore::set_up(const std::string & test_name) { ASSERT_FALSE(rclcpp::ok()); @@ -76,6 +67,4 @@ void FakeTestNode::TearDown() tear_down(); } -} // namespace testing -} // namespace tools -} // namespace autoware +} // namespace autoware::fake_test_node diff --git a/common/fake_test_node/test/test_fake_test_node.cpp b/common/autoware_fake_test_node/test/test_fake_test_node.cpp similarity index 94% rename from common/fake_test_node/test/test_fake_test_node.cpp rename to common/autoware_fake_test_node/test/test_fake_test_node.cpp index 77e9294cb48c2..886433ed5fff6 100644 --- a/common/fake_test_node/test/test_fake_test_node.cpp +++ b/common/autoware_fake_test_node/test/test_fake_test_node.cpp @@ -17,7 +17,7 @@ /// \copyright Copyright 2021 Apex.AI, Inc. /// All rights reserved. -#include +#include #include #include @@ -30,8 +30,8 @@ using bool8_t = bool; -using FakeNodeFixture = autoware::tools::testing::FakeTestNode; -using FakeNodeFixtureParametrized = autoware::tools::testing::FakeTestNodeParametrized; +using FakeNodeFixture = autoware::fake_test_node::FakeTestNode; +using FakeNodeFixtureParametrized = autoware::fake_test_node::FakeTestNodeParametrized; using std_msgs::msg::Bool; using std_msgs::msg::Int32; diff --git a/control/autoware_trajectory_follower_node/package.xml b/control/autoware_trajectory_follower_node/package.xml index 848eb7d3b6d10..86a2592ebf5f4 100644 --- a/control/autoware_trajectory_follower_node/package.xml +++ b/control/autoware_trajectory_follower_node/package.xml @@ -40,9 +40,9 @@ ament_index_cpp ament_index_python ament_lint_auto + autoware_fake_test_node autoware_lint_common autoware_testing - fake_test_node ros_testing diff --git a/control/autoware_trajectory_follower_node/test/test_controller_node.cpp b/control/autoware_trajectory_follower_node/test/test_controller_node.cpp index 71813c8a5c5d8..40e4366d9aa17 100644 --- a/control/autoware_trajectory_follower_node/test/test_controller_node.cpp +++ b/control/autoware_trajectory_follower_node/test/test_controller_node.cpp @@ -13,8 +13,8 @@ // limitations under the License. #include "ament_index_cpp/get_package_share_directory.hpp" +#include "autoware/fake_test_node/fake_test_node.hpp" #include "autoware/trajectory_follower_node/controller_node.hpp" -#include "fake_test_node/fake_test_node.hpp" #include "gtest/gtest.h" #include "rclcpp/rclcpp.hpp" #include "rclcpp/time.hpp" @@ -42,7 +42,7 @@ using SteeringReport = autoware_vehicle_msgs::msg::SteeringReport; using autoware_adapi_v1_msgs::msg::OperationModeState; using geometry_msgs::msg::AccelWithCovarianceStamped; -using FakeNodeFixture = autoware::tools::testing::FakeTestNode; +using FakeNodeFixture = autoware::fake_test_node::FakeTestNode; const rclcpp::Duration one_second(1, 0); diff --git a/control/autoware_trajectory_follower_node/test/trajectory_follower_test_utils.hpp b/control/autoware_trajectory_follower_node/test/trajectory_follower_test_utils.hpp index 1ccffcaf7f3e3..31c5bad619cb9 100644 --- a/control/autoware_trajectory_follower_node/test/trajectory_follower_test_utils.hpp +++ b/control/autoware_trajectory_follower_node/test/trajectory_follower_test_utils.hpp @@ -15,7 +15,7 @@ #ifndef TRAJECTORY_FOLLOWER_TEST_UTILS_HPP_ #define TRAJECTORY_FOLLOWER_TEST_UTILS_HPP_ -#include "fake_test_node/fake_test_node.hpp" +#include "autoware/fake_test_node/fake_test_node.hpp" #include "rclcpp/rclcpp.hpp" #include "rclcpp/time.hpp" #include "tf2_ros/static_transform_broadcaster.h" @@ -27,7 +27,7 @@ namespace test_utils { -using FakeNodeFixture = autoware::tools::testing::FakeTestNode; +using FakeNodeFixture = autoware::fake_test_node::FakeTestNode; inline void waitForMessage( const std::shared_ptr & node, FakeNodeFixture * fixture, const bool & received_flag, diff --git a/planning/autoware_path_optimizer/package.xml b/planning/autoware_path_optimizer/package.xml index 5dd763494ada0..7c5b1e68e759a 100644 --- a/planning/autoware_path_optimizer/package.xml +++ b/planning/autoware_path_optimizer/package.xml @@ -34,9 +34,9 @@ ament_cmake_ros ament_index_python ament_lint_auto + autoware_fake_test_node autoware_lint_common autoware_testing - fake_test_node ament_cmake diff --git a/planning/autoware_path_smoother/package.xml b/planning/autoware_path_smoother/package.xml index a9ead8e54d104..6c8b3efec678b 100644 --- a/planning/autoware_path_smoother/package.xml +++ b/planning/autoware_path_smoother/package.xml @@ -31,9 +31,9 @@ ament_cmake_ros ament_index_python ament_lint_auto + autoware_fake_test_node autoware_lint_common autoware_testing - fake_test_node ament_cmake diff --git a/planning/sampling_based_planner/autoware_path_sampler/package.xml b/planning/sampling_based_planner/autoware_path_sampler/package.xml index 188839c805179..c4dafda08a14c 100644 --- a/planning/sampling_based_planner/autoware_path_sampler/package.xml +++ b/planning/sampling_based_planner/autoware_path_sampler/package.xml @@ -34,9 +34,9 @@ ament_cmake_ros ament_index_python ament_lint_auto + autoware_fake_test_node autoware_lint_common autoware_testing - fake_test_node ament_cmake