diff --git a/ortools/routing/BUILD.bazel b/ortools/routing/BUILD.bazel index dd1bc17155..50d4d1725f 100644 --- a/ortools/routing/BUILD.bazel +++ b/ortools/routing/BUILD.bazel @@ -62,6 +62,37 @@ cc_test( ], ) +cc_library( + name = "lilim_parser", + srcs = ["lilim_parser.cc"], + hdrs = ["lilim_parser.h"], + deps = [ + ":simple_graph", + "//ortools/base:file", + "//ortools/base:numbers", + "//ortools/base:path", + "//ortools/base:zipfile", + "//ortools/util:filelineiter", + "@com_google_absl//absl/strings", + ], +) + +cc_test( + name = "lilim_parser_test", + size = "small", + srcs = ["lilim_parser_test.cc"], + data = [ + "//ortools/routing/testdata:lilim.zip", + "//ortools/routing/testdata:pdptw_LRC2_10_6.txt", + ], + deps = [ + ":lilim_parser", + "//ortools/base:path", + "@com_google_absl//absl/flags:flag", + "@com_google_googletest//:gtest_main", + ], +) + cc_library( name = "carp_parser", srcs = ["carp_parser.cc"], diff --git a/ortools/routing/lilim_parser_test.cc b/ortools/routing/lilim_parser_test.cc index 0a96d2c829..ee0eca8b08 100644 --- a/ortools/routing/lilim_parser_test.cc +++ b/ortools/routing/lilim_parser_test.cc @@ -18,7 +18,6 @@ #include "absl/flags/flag.h" #include "gtest/gtest.h" #include "ortools/base/path.h" -#include "testing/base/public/googletest.h" #if defined(_MSC_VER) #define ROOT_DIR "../../../../../../../" @@ -85,17 +84,5 @@ TEST(LiLimParserTest, LoadNonExistingInstance) { "ortools/routing/testdata/lilim.zip"))); } -TEST(LiLimParserTest, LoadExistingInstance) { - LiLimParser parser; - EXPECT_TRUE(parser.LoadFile( - "pdptw_LRC2_10_6.txt", - file::JoinPath("/zip", absl::GetFlag(FLAGS_test_srcdir), - ROOT_DIR "ortools/routing/testdata/lilim.zip"))); - CheckData(parser); - // Load a non-existing archive to check the parser was cleaned. - EXPECT_FALSE(parser.LoadFile("pdptw_LRC2_10_6.txt", "")); - EXPECT_EQ(parser.NumberOfNodes(), 0); -} - } // namespace } // namespace operations_research diff --git a/ortools/routing/testdata/BUILD.bazel b/ortools/routing/testdata/BUILD.bazel index e8ab11dbfd..c82b516dc4 100644 --- a/ortools/routing/testdata/BUILD.bazel +++ b/ortools/routing/testdata/BUILD.bazel @@ -27,10 +27,12 @@ exports_files([ "carp_gdb19_mixed_arcs.dat", "carp_gdb19_no_arista_req.dat", "carp_toy.dat", + "lilim.zip", "n20w20.001.txt", "n20w20.002.txt", "nearp_BHW1.dat", "nearp_toy.dat", + "pdptw_LRC2_10_6.txt", "pdtsp_prob10b.txt.gz", "pdtsp_prob10b.txt", "rc201.0",