diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index cfa764d6cc..ef167bb66b 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -989,6 +989,7 @@ cc_library( ":port", ":protobuf", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/time", @@ -1105,6 +1106,7 @@ cc_test( deps = [ ":protobuf", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -1131,6 +1133,7 @@ cc_test( "//src/google/protobuf/io:tokenizer", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:btree", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/functional:any_invocable", @@ -1192,6 +1195,7 @@ cc_test( ":test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -1216,6 +1220,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "//src/google/protobuf/util:differencer", "@com_google_absl//absl/base", "@com_google_absl//absl/strings", @@ -1240,6 +1245,7 @@ cc_test( "//src/google/protobuf/io:tokenizer", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/log:die_if_null", @@ -1269,6 +1275,7 @@ cc_test( ":test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", @@ -1401,6 +1408,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/io:tokenizer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "//src/google/protobuf/util:differencer", "//src/google/protobuf/util:time_util", "@com_google_absl//absl/base", @@ -1436,6 +1444,7 @@ cc_test( "//src/google/protobuf/io:io_win32", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "//src/google/protobuf/util:differencer", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:scoped_mock_log", @@ -1476,6 +1485,7 @@ cc_test( ":cc_test_protos", ":protobuf", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -1498,6 +1508,7 @@ cc_test( ":test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", @@ -1522,6 +1533,7 @@ cc_test( ":lite_test_util", ":protobuf", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -1542,6 +1554,7 @@ cc_test( ":test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", @@ -1592,6 +1605,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/numeric:bits", "@com_google_absl//absl/random", @@ -1624,6 +1638,7 @@ cc_test( "//src/google/protobuf/io:tokenizer", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "//third_party/utf8_range:utf8_validity", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:die_if_null", @@ -1653,6 +1668,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/functional:bind_front", "@com_google_absl//absl/strings:cord", @@ -1677,6 +1693,7 @@ cc_test( ":protobuf", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -1698,6 +1715,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "//src/google/protobuf/util:differencer", "@com_google_absl//absl/base", "@com_google_absl//absl/log:absl_check", diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index 519bfc4e41..abf9de460d 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -255,6 +255,7 @@ cc_library( "//src/google/protobuf/io", "//src/google/protobuf/io:printer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", "@com_google_absl//absl/types:optional", @@ -316,6 +317,7 @@ cc_library( "//src/google/protobuf/io:printer", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", @@ -360,6 +362,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/io:tokenizer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", @@ -412,6 +415,7 @@ cc_test( "//src/google/protobuf/io:io_win32", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", @@ -438,6 +442,7 @@ cc_library( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/status", "@com_google_absl//absl/strings", @@ -456,6 +461,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/status", @@ -487,6 +493,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/memory", diff --git a/src/google/protobuf/compiler/cpp/BUILD.bazel b/src/google/protobuf/compiler/cpp/BUILD.bazel index 8f87ce26fb..9330442d4b 100644 --- a/src/google/protobuf/compiler/cpp/BUILD.bazel +++ b/src/google/protobuf/compiler/cpp/BUILD.bazel @@ -179,6 +179,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -206,6 +207,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", @@ -224,6 +226,7 @@ cc_test( "//src/google/protobuf:cc_test_protos", "//src/google/protobuf:port", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", @@ -269,6 +272,7 @@ cc_test( "//src/google/protobuf/compiler:annotation_test_util", "//src/google/protobuf/compiler:command_line_interface", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", @@ -327,6 +331,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/io:printer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", diff --git a/src/google/protobuf/compiler/csharp/BUILD.bazel b/src/google/protobuf/compiler/csharp/BUILD.bazel index 0994bd71d9..a5a499ed9e 100644 --- a/src/google/protobuf/compiler/csharp/BUILD.bazel +++ b/src/google/protobuf/compiler/csharp/BUILD.bazel @@ -104,6 +104,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", diff --git a/src/google/protobuf/compiler/java/BUILD.bazel b/src/google/protobuf/compiler/java/BUILD.bazel index c25b0c4d64..9c4b2ea760 100644 --- a/src/google/protobuf/compiler/java/BUILD.bazel +++ b/src/google/protobuf/compiler/java/BUILD.bazel @@ -184,6 +184,7 @@ cc_test( "//src/google/protobuf/io:printer", "//src/google/protobuf/stubs:lite", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", diff --git a/src/google/protobuf/compiler/python/BUILD.bazel b/src/google/protobuf/compiler/python/BUILD.bazel index 6db988f37f..1271e84c10 100644 --- a/src/google/protobuf/compiler/python/BUILD.bazel +++ b/src/google/protobuf/compiler/python/BUILD.bazel @@ -55,6 +55,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/io:printer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", diff --git a/src/google/protobuf/compiler/ruby/BUILD.bazel b/src/google/protobuf/compiler/ruby/BUILD.bazel index 4792171a7a..ef21ebde0c 100644 --- a/src/google/protobuf/compiler/ruby/BUILD.bazel +++ b/src/google/protobuf/compiler/ruby/BUILD.bazel @@ -52,6 +52,7 @@ cc_test( "//src/google/protobuf/io", "//src/google/protobuf/io:printer", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], diff --git a/src/google/protobuf/editions/BUILD b/src/google/protobuf/editions/BUILD index b118767afc..2cd0092fd8 100644 --- a/src/google/protobuf/editions/BUILD +++ b/src/google/protobuf/editions/BUILD @@ -79,6 +79,7 @@ cc_test( "//src/google/protobuf:unittest_features_cc_proto", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@bazel_tools//tools/cpp/runfiles", "@com_google_absl//absl/memory", "@com_google_absl//absl/status", diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel index c3c7b893dd..b18fb336e0 100644 --- a/src/google/protobuf/io/BUILD.bazel +++ b/src/google/protobuf/io/BUILD.bazel @@ -108,6 +108,7 @@ cc_library( "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/cleanup", "@com_google_absl//absl/container:flat_hash_map", + "@com_google_absl//absl/functional:any_invocable", "@com_google_absl//absl/functional:function_ref", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_log", @@ -204,6 +205,7 @@ cc_test( "//src/google/protobuf:test_util2", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/base", "@com_google_absl//absl/base:log_severity", "@com_google_absl//absl/container:flat_hash_map", diff --git a/src/google/protobuf/stubs/BUILD.bazel b/src/google/protobuf/stubs/BUILD.bazel index ba0aeefdac..25d3db0cbc 100644 --- a/src/google/protobuf/stubs/BUILD.bazel +++ b/src/google/protobuf/stubs/BUILD.bazel @@ -73,6 +73,7 @@ cc_test( ":lite", ":stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest", diff --git a/src/google/protobuf/testing/BUILD.bazel b/src/google/protobuf/testing/BUILD.bazel index b5e9ddb78f..7c82104611 100644 --- a/src/google/protobuf/testing/BUILD.bazel +++ b/src/google/protobuf/testing/BUILD.bazel @@ -9,21 +9,38 @@ package( default_visibility = ["//:__subpackages__"], ) +cc_library( + name = "file", + srcs = ["file.cc"], + hdrs = ["file.h"], + copts = COPTS, + strip_include_prefix = "/src", + deps = [ + "//src/google/protobuf:port", + "//src/google/protobuf/io", + "//src/google/protobuf/io:io_win32", + "//src/google/protobuf/stubs:lite", + "@com_google_absl//absl/log:absl_check", + "@com_google_absl//absl/log:absl_log", + "@com_google_absl//absl/status", + "@com_google_absl//absl/strings", + ], +) + cc_library( name = "testing", testonly = 1, srcs = [ - "file.cc", "googletest.cc", ], hdrs = [ - "file.h", "googletest.h", ], copts = COPTS, linkopts = LINK_OPTS, strip_include_prefix = "/src", deps = [ + ":file", "//:protobuf_lite", # for ShutdownProtobufLibrary "//src/google/protobuf:port", "//src/google/protobuf/io", diff --git a/src/google/protobuf/testing/file.h b/src/google/protobuf/testing/file.h index 40762f309d..74dfdbf98a 100644 --- a/src/google/protobuf/testing/file.h +++ b/src/google/protobuf/testing/file.h @@ -21,7 +21,7 @@ namespace protobuf { const int DEFAULT_FILE_MODE = 0777; // Protocol buffer code only uses a couple static methods of File, and only -// in tests. +// in the Rust plugin and in tests. class File { public: File(const File&) = delete; diff --git a/src/google/protobuf/util/BUILD.bazel b/src/google/protobuf/util/BUILD.bazel index ea74afcfc4..b0b1506846 100644 --- a/src/google/protobuf/util/BUILD.bazel +++ b/src/google/protobuf/util/BUILD.bazel @@ -30,6 +30,7 @@ cc_test( "//src/google/protobuf:cc_test_protos", "//src/google/protobuf:test_util", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -72,6 +73,7 @@ cc_test( "//src/google/protobuf", "//src/google/protobuf:cc_test_protos", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -96,6 +98,7 @@ cc_test( "//src/google/protobuf:test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_absl//absl/functional:bind_front", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/memory", @@ -138,6 +141,7 @@ cc_test( "//src/google/protobuf:test_util", "//src/google/protobuf/stubs", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -184,6 +188,7 @@ cc_test( "//src/google/protobuf:duration_cc_proto", "//src/google/protobuf:timestamp_cc_proto", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], @@ -232,6 +237,7 @@ cc_test( "//src/google/protobuf:type_cc_proto", "//src/google/protobuf:wrappers_cc_proto", "//src/google/protobuf/testing", + "//src/google/protobuf/testing:file", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ],