From 2925d1508cec484752f537e3dc27306adf7324a3 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 21 Feb 2024 18:28:57 +0100 Subject: [PATCH] math_opt: update --- ortools/math_opt/cpp/BUILD.bazel | 2 +- ortools/math_opt/cpp/matchers.cc | 2 +- ortools/math_opt/cpp/matchers.h | 2 +- ortools/math_opt/cpp/message_callback.cc | 18 ++++ ortools/math_opt/cpp/message_callback.h | 22 +++++ ortools/math_opt/solver_tests/BUILD.bazel | 82 +++++++++---------- .../math_opt/solver_tests/callback_tests.cc | 2 +- .../math_opt/solver_tests/generic_tests.cc | 2 +- .../infeasible_subsystem_tests.cc | 2 +- .../solver_tests/invalid_input_tests.cc | 2 +- .../ip_model_solve_parameters_tests.cc | 2 +- .../ip_multiple_solutions_tests.cc | 2 +- .../solver_tests/ip_parameter_tests.cc | 2 +- .../solver_tests/logical_constraint_tests.cc | 2 +- .../solver_tests/lp_incomplete_solve_tests.cc | 2 +- .../lp_model_solve_parameters_tests.cc | 2 +- .../solver_tests/lp_parameter_tests.cc | 2 +- ortools/math_opt/solver_tests/lp_tests.cc | 2 +- ortools/math_opt/solver_tests/mip_tests.cc | 2 +- .../solver_tests/multi_objective_tests.cc | 2 +- ortools/math_opt/solver_tests/qc_tests.cc | 2 +- ortools/math_opt/solver_tests/qp_tests.cc | 2 +- .../solver_tests/second_order_cone_tests.cc | 2 +- ortools/math_opt/solver_tests/status_tests.cc | 2 +- .../math_opt/solver_tests/test_models_test.cc | 2 +- .../solver_tests/unregistered_solver_test.cc | 2 +- 26 files changed, 104 insertions(+), 64 deletions(-) diff --git a/ortools/math_opt/cpp/BUILD.bazel b/ortools/math_opt/cpp/BUILD.bazel index e9556c3520..85d58be873 100644 --- a/ortools/math_opt/cpp/BUILD.bazel +++ b/ortools/math_opt/cpp/BUILD.bazel @@ -423,6 +423,7 @@ cc_library( ":math_opt", ":update_result", ":variable_and_expressions", + "//ortools/base:gmock", "//ortools/base:logging", "//ortools/base:message_matchers", "//ortools/base:status_matchers", @@ -432,7 +433,6 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:span", - "@com_google_googletest//:gtest", ], ) diff --git a/ortools/math_opt/cpp/matchers.cc b/ortools/math_opt/cpp/matchers.cc index 0556c29c0e..ad4fe613db 100644 --- a/ortools/math_opt/cpp/matchers.cc +++ b/ortools/math_opt/cpp/matchers.cc @@ -27,8 +27,8 @@ #include "absl/log/check.h" #include "absl/strings/str_cat.h" #include "absl/types/span.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/base/message_matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/cpp/matchers.h b/ortools/math_opt/cpp/matchers.h index cf1d3583e6..260fb77f6f 100644 --- a/ortools/math_opt/cpp/matchers.h +++ b/ortools/math_opt/cpp/matchers.h @@ -99,8 +99,8 @@ #include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/status_matchers.h" #include "ortools/math_opt/cpp/linear_constraint.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/cpp/message_callback.cc b/ortools/math_opt/cpp/message_callback.cc index 791c5f542b..892c97b394 100644 --- a/ortools/math_opt/cpp/message_callback.cc +++ b/ortools/math_opt/cpp/message_callback.cc @@ -90,6 +90,24 @@ MessageCallback PrinterMessageCallback(std::ostream& output_stream, [=](const std::vector& messages) { impl->Call(messages); }; } +MessageCallback InfoLoggerMessageCallback(const absl::string_view prefix, + const absl::SourceLocation loc) { + return [=](const std::vector& messages) { + for (const std::string& message : messages) { + LOG(INFO).AtLocation(loc.file_name(), loc.line()) << prefix << message; + } + }; +} + +MessageCallback VLoggerMessageCallback(int level, absl::string_view prefix, + absl::SourceLocation loc) { + return [=](const std::vector& messages) { + for (const std::string& message : messages) { + VLOG(level).AtLocation(loc.file_name(), loc.line()) << prefix << message; + } + }; +} + MessageCallback VectorMessageCallback(std::vector* sink) { CHECK(sink != nullptr); // Here we must use an std::shared_ptr since std::function requires that its diff --git a/ortools/math_opt/cpp/message_callback.h b/ortools/math_opt/cpp/message_callback.h index 4ec126b89c..4736d8daf7 100644 --- a/ortools/math_opt/cpp/message_callback.h +++ b/ortools/math_opt/cpp/message_callback.h @@ -51,6 +51,28 @@ using MessageCallback = std::function&)>; MessageCallback PrinterMessageCallback(std::ostream& output_stream = std::cout, absl::string_view prefix = ""); +// Returns a message callback function that prints each line to LOG(INFO), +// prefixing each line with the given prefix. +// +// Usage: +// +// SolveArguments args; +// args.message_callback = InfoLoggerMessageCallback("[solver] "); +MessageCallback InfoLoggerMessageCallback( + absl::string_view prefix = "", + absl::SourceLocation loc = absl::SourceLocation::current()); + +// Returns a message callback function that prints each line to VLOG(level), +// prefixing each line with the given prefix. +// +// Usage: +// +// SolveArguments args; +// args.message_callback = VLoggerMessageCallback(1, "[solver] "); +MessageCallback VLoggerMessageCallback( + int level, absl::string_view prefix = "", + absl::SourceLocation loc = absl::SourceLocation::current()); + // Returns a message callback function that aggregates all messages in the // provided vector. // diff --git a/ortools/math_opt/solver_tests/BUILD.bazel b/ortools/math_opt/solver_tests/BUILD.bazel index 1509e38b6c..f69658668d 100644 --- a/ortools/math_opt/solver_tests/BUILD.bazel +++ b/ortools/math_opt/solver_tests/BUILD.bazel @@ -19,10 +19,10 @@ cc_library( srcs = ["base_solver_test.cc"], hdrs = ["base_solver_test.h"], deps = [ + "//ortools/base:gmock", "//ortools/base:linked_hash_map", "//ortools/math_opt/cpp:math_opt", "@com_google_absl//absl/log", - "@com_google_googletest//:gtest", ], ) @@ -33,6 +33,7 @@ cc_library( hdrs = ["lp_tests.h"], deps = [ ":base_solver_test", + "//ortools/base:gmock", "//ortools/math_opt:solution_cc_proto", "//ortools/math_opt/core:solver", "//ortools/math_opt/cpp:matchers", @@ -40,7 +41,6 @@ cc_library( "//ortools/port:proto_utils", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -54,13 +54,13 @@ cc_library( deps = [ ":test_models", "//ortools/base", + "//ortools/base:gmock", "//ortools/math_opt:parameters_cc_proto", "//ortools/math_opt:result_cc_proto", "//ortools/math_opt:solution_cc_proto", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -73,6 +73,7 @@ cc_library( hdrs = ["invalid_input_tests.h"], deps = [ ":base_solver_test", + "//ortools/base:gmock", "//ortools/base:status_matchers", "//ortools/math_opt:model_cc_proto", "//ortools/math_opt:model_update_cc_proto", @@ -84,7 +85,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -98,11 +98,11 @@ cc_library( deps = [ ":base_solver_test", "//ortools/base", + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -115,13 +115,13 @@ cc_library( hdrs = ["ip_model_solve_parameters_tests.h"], deps = [ ":base_solver_test", + "//ortools/base:gmock", "//ortools/base:status_macros", "//ortools/math_opt:parameters_cc_proto", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -133,11 +133,11 @@ cc_library( srcs = ["ip_multiple_solutions_tests.cc"], hdrs = ["ip_multiple_solutions_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -151,10 +151,10 @@ cc_library( deps = [ ":base_solver_test", ":test_models", + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -166,6 +166,7 @@ cc_library( srcs = ["lp_parameter_tests.cc"], hdrs = ["lp_parameter_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/base:status_macros", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", @@ -175,7 +176,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -188,11 +188,11 @@ cc_library( hdrs = ["lp_initial_basis_tests.h"], deps = [ ":base_solver_test", + "//ortools/base:gmock", "//ortools/math_opt:solution_cc_proto", "//ortools/math_opt/cpp:math_opt", "@com_google_absl//absl/log:check", "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -204,6 +204,7 @@ cc_library( srcs = ["multi_objective_tests.cc"], hdrs = ["multi_objective_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/base:status_macros", "//ortools/math_opt:model_cc_proto", "//ortools/math_opt:model_update_cc_proto", @@ -214,7 +215,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -227,12 +227,12 @@ cc_library( hdrs = ["qp_tests.h"], deps = [ "//ortools/base", + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -244,13 +244,13 @@ cc_library( srcs = ["qc_tests.cc"], hdrs = ["qc_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -262,13 +262,13 @@ cc_library( srcs = ["second_order_cone_tests.cc"], hdrs = ["second_order_cone_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", "//ortools/port:proto_utils", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -280,6 +280,7 @@ cc_library( srcs = ["logical_constraint_tests.cc"], hdrs = ["logical_constraint_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/math_opt:model_update_cc_proto", "//ortools/math_opt:result_cc_proto", "//ortools/math_opt/cpp:matchers", @@ -288,7 +289,6 @@ cc_library( "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, @@ -306,31 +306,31 @@ cc_library( ], ) -# missing InfoLoggerMessageCallback -#cc_library( -# name = "generic_tests", -# testonly = True, -# srcs = ["generic_tests.cc"], -# hdrs = ["generic_tests.h"], -# deps = [ -# ":test_models", -# "//ortools/base:logging", -# "//ortools/math_opt/core:inverted_bounds", -# "//ortools/math_opt/cpp:matchers", -# "//ortools/math_opt/cpp:math_opt", -# "//ortools/port:proto_utils", -# "@com_google_absl//absl/base:log_severity", -# "@com_google_absl//absl/container:flat_hash_set", -# "@com_google_absl//absl/log", -# "@com_google_absl//absl/status:statusor", -# "@com_google_absl//absl/strings", -# "@com_google_absl//absl/synchronization", -# "@com_google_absl//absl/time", -# "@com_google_googletest//:gtest", -# ], -# # Make sure the tests are included when using --dynamic_mode=off. -# alwayslink = 1, -#) +cc_library( + name = "generic_tests", + testonly = True, + srcs = ["generic_tests.cc"], + hdrs = ["generic_tests.h"], + deps = [ + ":test_models", + "//ortools/base:gmock", + "//ortools/base:logging", + "//ortools/math_opt/core:inverted_bounds", + "//ortools/math_opt/cpp:matchers", + "//ortools/math_opt/cpp:math_opt", + "//ortools/port:proto_utils", + "//ortools/port:scoped_std_stream_capture", + "@com_google_absl//absl/base:log_severity", + "@com_google_absl//absl/container:flat_hash_set", + "@com_google_absl//absl/log", + "@com_google_absl//absl/status:statusor", + "@com_google_absl//absl/strings", + "@com_google_absl//absl/synchronization", + "@com_google_absl//absl/time", + ], + # Make sure the tests are included when using --dynamic_mode=off. + alwayslink = 1, +) cc_library( name = "infeasible_subsystem_tests", @@ -338,6 +338,7 @@ cc_library( srcs = ["infeasible_subsystem_tests.cc"], hdrs = ["infeasible_subsystem_tests.h"], deps = [ + "//ortools/base:gmock", "//ortools/math_opt:infeasible_subsystem_cc_proto", "//ortools/math_opt/cpp:matchers", "//ortools/math_opt/cpp:math_opt", @@ -346,7 +347,6 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/time", - "@com_google_googletest//:gtest", ], # Make sure the tests are included when using --dynamic_mode=off. alwayslink = 1, diff --git a/ortools/math_opt/solver_tests/callback_tests.cc b/ortools/math_opt/solver_tests/callback_tests.cc index e64cef088a..47dae6ec18 100644 --- a/ortools/math_opt/solver_tests/callback_tests.cc +++ b/ortools/math_opt/solver_tests/callback_tests.cc @@ -31,8 +31,8 @@ #include "absl/strings/string_view.h" #include "absl/synchronization/mutex.h" #include "absl/types/span.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/base/map_util.h" #include "ortools/base/status_macros.h" diff --git a/ortools/math_opt/solver_tests/generic_tests.cc b/ortools/math_opt/solver_tests/generic_tests.cc index ae5a6d84e3..b0d94013d5 100644 --- a/ortools/math_opt/solver_tests/generic_tests.cc +++ b/ortools/math_opt/solver_tests/generic_tests.cc @@ -30,8 +30,8 @@ #include "absl/synchronization/mutex.h" #include "absl/time/clock.h" #include "absl/time/time.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/math_opt/core/inverted_bounds.h" #include "ortools/math_opt/cpp/matchers.h" diff --git a/ortools/math_opt/solver_tests/infeasible_subsystem_tests.cc b/ortools/math_opt/solver_tests/infeasible_subsystem_tests.cc index 88b461d6c0..96f900b49a 100644 --- a/ortools/math_opt/solver_tests/infeasible_subsystem_tests.cc +++ b/ortools/math_opt/solver_tests/infeasible_subsystem_tests.cc @@ -23,8 +23,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_join.h" #include "absl/time/time.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/math_opt/infeasible_subsystem.pb.h" diff --git a/ortools/math_opt/solver_tests/invalid_input_tests.cc b/ortools/math_opt/solver_tests/invalid_input_tests.cc index f9fab8b1e1..b4b3b8cbd5 100644 --- a/ortools/math_opt/solver_tests/invalid_input_tests.cc +++ b/ortools/math_opt/solver_tests/invalid_input_tests.cc @@ -21,8 +21,8 @@ #include "absl/status/status.h" #include "absl/strings/str_join.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/status_matchers.h" #include "ortools/math_opt/core/solver.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/ip_model_solve_parameters_tests.cc b/ortools/math_opt/solver_tests/ip_model_solve_parameters_tests.cc index 296579d3a3..27ec82508e 100644 --- a/ortools/math_opt/solver_tests/ip_model_solve_parameters_tests.cc +++ b/ortools/math_opt/solver_tests/ip_model_solve_parameters_tests.cc @@ -20,8 +20,8 @@ #include #include "absl/status/statusor.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/status_macros.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/ip_multiple_solutions_tests.cc b/ortools/math_opt/solver_tests/ip_multiple_solutions_tests.cc index 13a4a5b4bf..9b56227d5c 100644 --- a/ortools/math_opt/solver_tests/ip_multiple_solutions_tests.cc +++ b/ortools/math_opt/solver_tests/ip_multiple_solutions_tests.cc @@ -18,8 +18,8 @@ #include #include "absl/strings/str_cat.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/port/proto_utils.h" diff --git a/ortools/math_opt/solver_tests/ip_parameter_tests.cc b/ortools/math_opt/solver_tests/ip_parameter_tests.cc index 7b811078c1..7e0b7b29ce 100644 --- a/ortools/math_opt/solver_tests/ip_parameter_tests.cc +++ b/ortools/math_opt/solver_tests/ip_parameter_tests.cc @@ -77,8 +77,8 @@ #include "absl/strings/string_view.h" #include "absl/time/time.h" #include "absl/types/span.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/base/status_macros.h" #include "ortools/math_opt/cpp/matchers.h" diff --git a/ortools/math_opt/solver_tests/logical_constraint_tests.cc b/ortools/math_opt/solver_tests/logical_constraint_tests.cc index f7df1e6470..75577065ff 100644 --- a/ortools/math_opt/solver_tests/logical_constraint_tests.cc +++ b/ortools/math_opt/solver_tests/logical_constraint_tests.cc @@ -22,8 +22,8 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/math_opt/model_update.pb.h" diff --git a/ortools/math_opt/solver_tests/lp_incomplete_solve_tests.cc b/ortools/math_opt/solver_tests/lp_incomplete_solve_tests.cc index 24ddd4020c..f064abbc0d 100644 --- a/ortools/math_opt/solver_tests/lp_incomplete_solve_tests.cc +++ b/ortools/math_opt/solver_tests/lp_incomplete_solve_tests.cc @@ -23,8 +23,8 @@ #include #include "absl/strings/str_cat.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/lp_model_solve_parameters_tests.cc b/ortools/math_opt/solver_tests/lp_model_solve_parameters_tests.cc index 06b3936deb..ee8b75b176 100644 --- a/ortools/math_opt/solver_tests/lp_model_solve_parameters_tests.cc +++ b/ortools/math_opt/solver_tests/lp_model_solve_parameters_tests.cc @@ -17,8 +17,8 @@ #include #include -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/math_opt/solver_tests/base_solver_test.h" diff --git a/ortools/math_opt/solver_tests/lp_parameter_tests.cc b/ortools/math_opt/solver_tests/lp_parameter_tests.cc index 52ca491a87..26ce91a8a8 100644 --- a/ortools/math_opt/solver_tests/lp_parameter_tests.cc +++ b/ortools/math_opt/solver_tests/lp_parameter_tests.cc @@ -36,8 +36,8 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/base/status_macros.h" #include "ortools/math_opt/cpp/matchers.h" diff --git a/ortools/math_opt/solver_tests/lp_tests.cc b/ortools/math_opt/solver_tests/lp_tests.cc index cf92ffdca5..dfae7371f5 100644 --- a/ortools/math_opt/solver_tests/lp_tests.cc +++ b/ortools/math_opt/solver_tests/lp_tests.cc @@ -26,8 +26,8 @@ #include "absl/log/check.h" #include "absl/status/statusor.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/core/solver.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/mip_tests.cc b/ortools/math_opt/solver_tests/mip_tests.cc index 4f206aa923..8c9cbd36e8 100644 --- a/ortools/math_opt/solver_tests/mip_tests.cc +++ b/ortools/math_opt/solver_tests/mip_tests.cc @@ -23,8 +23,8 @@ #include "absl/log/check.h" #include "absl/status/statusor.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/multi_objective_tests.cc b/ortools/math_opt/solver_tests/multi_objective_tests.cc index f3f1fe3cb9..88f9009e36 100644 --- a/ortools/math_opt/solver_tests/multi_objective_tests.cc +++ b/ortools/math_opt/solver_tests/multi_objective_tests.cc @@ -20,8 +20,8 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/status_macros.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/qc_tests.cc b/ortools/math_opt/solver_tests/qc_tests.cc index e1a2459c6e..7aed4374a4 100644 --- a/ortools/math_opt/solver_tests/qc_tests.cc +++ b/ortools/math_opt/solver_tests/qc_tests.cc @@ -22,8 +22,8 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/port/proto_utils.h" diff --git a/ortools/math_opt/solver_tests/qp_tests.cc b/ortools/math_opt/solver_tests/qp_tests.cc index 71add22823..a161800118 100644 --- a/ortools/math_opt/solver_tests/qp_tests.cc +++ b/ortools/math_opt/solver_tests/qp_tests.cc @@ -21,8 +21,8 @@ #include #include "absl/status/status.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/logging.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/second_order_cone_tests.cc b/ortools/math_opt/solver_tests/second_order_cone_tests.cc index 2947ecefc8..0f2e6d08ae 100644 --- a/ortools/math_opt/solver_tests/second_order_cone_tests.cc +++ b/ortools/math_opt/solver_tests/second_order_cone_tests.cc @@ -22,8 +22,8 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" #include "ortools/port/proto_utils.h" diff --git a/ortools/math_opt/solver_tests/status_tests.cc b/ortools/math_opt/solver_tests/status_tests.cc index 7fae344693..6a56fdfc00 100644 --- a/ortools/math_opt/solver_tests/status_tests.cc +++ b/ortools/math_opt/solver_tests/status_tests.cc @@ -23,8 +23,8 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/base/status_macros.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/test_models_test.cc b/ortools/math_opt/solver_tests/test_models_test.cc index 2973961b63..80933145e3 100644 --- a/ortools/math_opt/solver_tests/test_models_test.cc +++ b/ortools/math_opt/solver_tests/test_models_test.cc @@ -15,8 +15,8 @@ #include -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/cpp/matchers.h" #include "ortools/math_opt/cpp/math_opt.h" diff --git a/ortools/math_opt/solver_tests/unregistered_solver_test.cc b/ortools/math_opt/solver_tests/unregistered_solver_test.cc index 6b869755d3..cabb3a01be 100644 --- a/ortools/math_opt/solver_tests/unregistered_solver_test.cc +++ b/ortools/math_opt/solver_tests/unregistered_solver_test.cc @@ -16,8 +16,8 @@ #include -#include "gmock/gmock.h" #include "gtest/gtest.h" +#include "ortools/base/gmock.h" #include "ortools/math_opt/core/solver_interface.h" #include "ortools/math_opt/parameters.pb.h"