Browse Source

Some fixes to make the tests pass on Bazel.

Joshua Haberman 5 years ago
parent
commit
243558921f
2 changed files with 4 additions and 0 deletions
  1. 1 0
      BUILD
  2. 3 0
      src/google/protobuf/compiler/command_line_interface.cc

+ 1 - 0
BUILD

@@ -524,6 +524,7 @@ RELATIVE_TEST_PROTOS = [
     "google/protobuf/unittest_proto3_arena.proto",
     "google/protobuf/unittest_proto3_arena_lite.proto",
     "google/protobuf/unittest_proto3_lite.proto",
+    "google/protobuf/unittest_proto3_optional.proto",
     "google/protobuf/unittest_well_known_types.proto",
     "google/protobuf/util/internal/testdata/anys.proto",
     "google/protobuf/util/internal/testdata/books.proto",

+ 3 - 0
src/google/protobuf/compiler/command_line_interface.cc

@@ -1105,6 +1105,9 @@ PopulateSingleSimpleDescriptorDatabase(const std::string& descriptor_set_name) {
 bool CommandLineInterface::AllowProto3Optional(
     const FileDescriptor& file) const {
   if (allow_proto3_optional_) return true;
+  if (file.name() == "google/protobuf/unittest_proto3_optional.proto") {
+    return true;
+  }
   return false;
 }