Merge pull request #23375 from jtattermusch/csharp_proto_collision_test

Add Grpc.Tools test for generating for .proto with the same name
reviewable/pr23443/r1^2
Jan Tattermusch 4 years ago committed by GitHub
commit c38bbd4b38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      test/distrib/csharp/DistribTest/Program.cs
  2. 23
      test/distrib/csharp/DistribTest/duplicate_proto/testcodegen.proto

@ -53,6 +53,14 @@ namespace TestGrpcPackage
server.ShutdownAsync().Wait(); server.ShutdownAsync().Wait();
} }
} }
// Test that codegen works well in case the .csproj has .proto files
// of the same name, but under different directories (see #17672).
// This method doesn't need to be used, it is enough to check that it builds.
private static object CheckDuplicateProtoFilesAreOk()
{
return new DuplicateProto.MessageFromDuplicateProto();
}
} }
class GreeterImpl : Greeter.GreeterBase class GreeterImpl : Greeter.GreeterBase

@ -0,0 +1,23 @@
// Copyright 2019 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Test that codegen works well in case the .csproj has .proto files
// of the same name, but under different directories (see #17672).
syntax = "proto3";
package duplicate_proto;
message MessageFromDuplicateProto {
string name = 1;
}
Loading…
Cancel
Save