Bläddra i källkod

Skip C# test in C++ only distribution.

Feng Xiao 8 år sedan
förälder
incheckning
3a5a0724f3
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc

+ 8 - 0
src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc

@@ -134,6 +134,14 @@ class GenerateAndTest {
 };
 
 TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) {
+  // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11
+  // only distribution).
+  string descriptor_file_name =
+      "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs";
+  if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) {
+    return;
+  }
+
   MockErrorCollector error_collector;
   DiskSourceTree source_tree;
   Importer importer(&source_tree, &error_collector);