From 6a20ba4697ffc3f6b0a6fd1c0075b4a4c574197e Mon Sep 17 00:00:00 2001 From: Michael Orlov Date: Mon, 22 Jul 2024 01:32:12 -0700 Subject: [PATCH] [WIP] Remove rcpputils::fs dependencies in rosbag2 packages (#1740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Orlov Signed-off-by: Alejandro Hernández Cordero Co-authored-by: Alejandro Hernández Cordero (cherry picked from commit 7a01d7890c5697dd734e761fb8ded0ca59015d39) --- rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp | 3 +-- .../rosbag2_test_common/temporary_directory_fixture.hpp | 4 ++-- rosbag2_transport/test/rosbag2_transport/test_rewrite.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp index fc628a299e..de3eedd9c2 100644 --- a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp +++ b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_reader.cpp @@ -26,7 +26,6 @@ #include "rosbag2_storage/bag_metadata.hpp" #include "rosbag2_storage/metadata_io.hpp" -#include "rosbag2_storage/ros_helper.hpp" #include "rosbag2_storage/topic_metadata.hpp" #include "rosbag2_test_common/tested_storage_ids.hpp" @@ -251,7 +250,7 @@ TEST_P(ParametrizedTemporaryDirectoryFixture, reader_accepts_bare_file) { } TEST_P(ParametrizedTemporaryDirectoryFixture, get_metadata_include_topics_with_zero_messages) { - const auto bag_path = rcpputils::fs::path(temporary_dir_path_) / "bag_with_no_msgs"; + const auto bag_path = fs::path(temporary_dir_path_) / "bag_with_no_msgs"; const std::string topic_name = "topic_with_0_messages"; const auto storage_id = GetParam(); { diff --git a/rosbag2_test_common/include/rosbag2_test_common/temporary_directory_fixture.hpp b/rosbag2_test_common/include/rosbag2_test_common/temporary_directory_fixture.hpp index aefb57aacd..7098e92861 100644 --- a/rosbag2_test_common/include/rosbag2_test_common/temporary_directory_fixture.hpp +++ b/rosbag2_test_common/include/rosbag2_test_common/temporary_directory_fixture.hpp @@ -31,12 +31,12 @@ class TemporaryDirectoryFixture : public Test public: TemporaryDirectoryFixture() { - temporary_dir_path_ = rcpputils::fs::create_temp_directory("tmp_test_dir_").string(); + temporary_dir_path_ = rcpputils::fs::create_temporary_directory("tmp_test_dir_").string(); } ~TemporaryDirectoryFixture() override { - rcpputils::fs::remove_all(rcpputils::fs::path(temporary_dir_path_)); + std::filesystem::remove_all(std::filesystem::path(temporary_dir_path_)); } std::string temporary_dir_path_; diff --git a/rosbag2_transport/test/rosbag2_transport/test_rewrite.cpp b/rosbag2_transport/test/rosbag2_transport/test_rewrite.cpp index 6cbf911fac..36ed868d94 100644 --- a/rosbag2_transport/test/rosbag2_transport/test_rewrite.cpp +++ b/rosbag2_transport/test/rosbag2_transport/test_rewrite.cpp @@ -53,7 +53,7 @@ class TestRewrite : public Test, public WithParamInterface public: TestRewrite() { - auto tmp_dir = rcpputils::fs::create_temp_directory("test_bag_rewrite"); + auto tmp_dir = rcpputils::fs::create_temporary_directory("test_bag_rewrite"); output_dir_ = fs::path(tmp_dir.string()); storage_id_ = GetParam(); bags_path_ = fs::path(_SRC_RESOURCES_DIR_PATH) / storage_id_;