Imported Upstream version 3.8.0
[platform/upstream/protobuf.git] / csharp / compatibility_tests / v3.0.0 / test.sh
index 54d28df..9fcf406 100755 (executable)
@@ -2,17 +2,17 @@
 
 function run_test() {
   # Generate test proto files.
-  ./protoc_1 -Iprotos/src -I../../../src/ --csharp_out=src/Google.Protobuf.Test \
+  $1 -Iprotos/src -I../../../src/ --csharp_out=src/Google.Protobuf.Test \
     --csharp_opt=base_namespace=Google.Protobuf \
     protos/src/google/protobuf/unittest_import_proto3.proto \
     protos/src/google/protobuf/unittest_import_public_proto3.proto \
     protos/src/google/protobuf/unittest_well_known_types.proto
 
-  ./protoc_1 -Iprotos/csharp --csharp_out=src/Google.Protobuf.Test \
+  $1 -Iprotos/csharp --csharp_out=src/Google.Protobuf.Test \
     --csharp_opt=base_namespace=UnitTest.Issues \
     protos/csharp/protos/unittest_issues.proto
 
-  ./protoc_2 -Iprotos/src --csharp_out=src/Google.Protobuf.Test \
+  $2 -Iprotos/src --csharp_out=src/Google.Protobuf.Test \
     --csharp_opt=base_namespace=Google.Protobuf \
     protos/src/google/protobuf/unittest_proto3.proto \
     protos/src/google/protobuf/map_unittest_proto3.proto
@@ -22,7 +22,7 @@ function run_test() {
   dotnet restore src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
   dotnet build -c Release src/Google.Protobuf/Google.Protobuf.csproj
   dotnet build -c Release src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
-  dotnet run -c Release -f netcoreapp1.0 -p src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
+  dotnet run -c Release -f netcoreapp2.1 -p src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
 }
 
 set -ex
@@ -79,26 +79,18 @@ cp ../../keys . -r
 # Test A.1:
 #   proto set 1: use old version
 #   proto set 2 which may import protos in set 1: use old version
-cp old_protoc protoc_1
-cp old_protoc protoc_2
-run_test
+run_test "./old_protoc" "./old_protoc"
 
 # Test A.2:
 #   proto set 1: use new version
 #   proto set 2 which may import protos in set 1: use old version
-cp ../../../src/protoc protoc_1
-cp old_protoc protoc_2
-run_test
+run_test "../../../src/protoc" "./old_protoc"
 
 # Test A.3:
 #   proto set 1: use old version
 #   proto set 2 which may import protos in set 1: use new version
-cp old_protoc protoc_1
-cp ../../../src/protoc protoc_2
-run_test
+run_test "./old_protoc" "../../../src/protoc"
 
-rm protoc_1
-rm protoc_2
 rm old_protoc
 rm keys -r
 rm src/Google.Protobuf -r