maliput / maliput_malidrive

Open-source ready OpenDrive backend for Maliput
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

[Bazel] Enable test for plugin #268

Open francocipollone opened 10 months ago

francocipollone commented 10 months ago

Summary

Related to #246

In the test road_network_plugin_test.cc we have:

// Resource folder path defined via compile definition.
static constexpr char kMalidriveResourceFolder[] = DEF_MALIDRIVE_RESOURCES;

GTEST_TEST(RoadNetworkLoader, VerifyRoadNetworkPlugin) {
  setenv("MALIPUT_PLUGIN_PATH", DEF_ROAD_NETWORK_PLUGIN, 1);
  const std::string kXodrFilePath{utility::FindResourceInPath("TShapeRoad.xodr", kMalidriveResourceFolder)};

In cmake world we have a compile definition for locating the resources and the plugin in the test suite:

    set(RESOURCE_FILE_PREFIX ${PROJECT_SOURCE_DIR}/resources/)
    set(ROAD_NETWORK_PLUGIN ${CMAKE_INSTALL_PREFIX}/lib/maliput_plugins/)
    target_compile_definitions(${BINARY_NAME}
      PRIVATE
        DEF_MALIDRIVE_RESOURCES="${RESOURCE_FILE_PREFIX}"
        DEF_ROAD_NETWORK_PLUGIN="${ROAD_NETWORK_PLUGIN}"
    )

Victory condition

Resolve this for the bazel world and enable testing for the plugin