Skip to content

Commit

Permalink
remove rcpputils and rcutils dependency (#61)
Browse files Browse the repository at this point in the history
Signed-off-by: Kenta Yonekura <[email protected]>
  • Loading branch information
yoneken authored Oct 6, 2023
1 parent 4dbe69b commit 6a42ed6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ if(BUILD_TESTING)
ament_lint_cmake("--filter=-convention/filename,-package/stdargs")

find_package(ament_cmake_gtest REQUIRED)
find_package(rcpputils REQUIRED)
find_package(performance_test_fixture REQUIRED)
# Give cppcheck hints about macro definitions coming from outside this package
get_target_property(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS
Expand All @@ -57,14 +56,12 @@ if(BUILD_TESTING)
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
if(TARGET test_yaml_reader)
target_link_libraries(test_yaml_reader yaml_library)
ament_target_dependencies(test_yaml_reader rcpputils)
endif()

add_performance_test(benchmark_reader test/benchmark/benchmark_reader.cpp
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
if(TARGET benchmark_reader)
target_link_libraries(benchmark_reader yaml_library)
ament_target_dependencies(benchmark_reader rcpputils)
endif()
endif()

Expand Down
2 changes: 0 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>performance_test_fixture</test_depend>
<test_depend>rcpputils</test_depend>
<test_depend>rcutils</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
9 changes: 5 additions & 4 deletions test/benchmark/benchmark_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

#include <yaml.h>

#include <filesystem>
#include <string>

#include "rcpputils/filesystem_helper.hpp"

#include "performance_test_fixture/performance_test_fixture.hpp"

using performance_test_fixture::PerformanceTest;
Expand Down Expand Up @@ -52,7 +51,8 @@ BENCHMARK_F(PerformanceTest, yaml_parser_set_input_string)(benchmark::State & st
BENCHMARK_F(PerformanceTest, yaml_parser_set_input_file)(benchmark::State & st)
{
std::string path =
(rcpputils::fs::current_path() / "test" / "benchmark" / "benchmark_params.yaml").string();
(std::filesystem::current_path() / "test" / "benchmark" /
"benchmark_params.yaml").generic_string();

yaml_parser_t parser;
FILE * pFile;
Expand All @@ -73,7 +73,8 @@ BENCHMARK_F(PerformanceTest, yaml_parser_set_input_file)(benchmark::State & st)
BENCHMARK_F(PerformanceTest, yaml_parser_set_input_file_event)(benchmark::State & st)
{
std::string path =
(rcpputils::fs::current_path() / "test" / "benchmark" / "benchmark_params.yaml").string();
(std::filesystem::current_path() / "test" / "benchmark" /
"benchmark_params.yaml").generic_string();

yaml_parser_t parser;
FILE * pFile;
Expand Down
10 changes: 5 additions & 5 deletions test/test_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
#include <gtest/gtest.h>
#include <yaml.h>

#include <filesystem>
#include <string>

#include "rcpputils/filesystem_helper.hpp"
#include "rcutils/filesystem.h"

TEST(test_libyaml, yaml_read_file)
{
std::string path =
(rcpputils::fs::current_path() / "test" / "benchmark" / "benchmark_params.yaml").string();
(std::filesystem::current_path() / "test" / "benchmark" /
"benchmark_params.yaml").generic_string();

yaml_parser_t parser;
yaml_event_t event;
Expand All @@ -46,7 +45,8 @@ TEST(test_libyaml, yaml_read_file)
TEST(test_libyaml, yaml_read_file_fails)
{
std::string path =
(rcpputils::fs::current_path() / "test" / "benchmark" / "benchmark_params.yaml").string();
(std::filesystem::current_path() / "test" / "benchmark" /
"benchmark_params.yaml").generic_string();

yaml_parser_t parser;
yaml_event_t event;
Expand Down

0 comments on commit 6a42ed6

Please sign in to comment.