浏览代码

Modified FindRubyTestDir to use GOOGLE_THIRD_PARTY_PROTOBUF

Austin Schuh 10 年之前
父节点
当前提交
1ecef1a2f5
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc

+ 4 - 0
src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc

@@ -47,6 +47,7 @@ namespace {
 
 
 string FindRubyTestDir(const string& file) {
 string FindRubyTestDir(const string& file) {
   // Inspired by TestSourceDir() in src/google/protobuf/testing/googletest.cc.
   // Inspired by TestSourceDir() in src/google/protobuf/testing/googletest.cc.
+#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
   string prefix = ".";
   string prefix = ".";
   while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby" + file)) {
   while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby" + file)) {
     if (!File::Exists(prefix)) {
     if (!File::Exists(prefix)) {
@@ -57,6 +58,9 @@ string FindRubyTestDir(const string& file) {
     prefix += "/..";
     prefix += "/..";
   }
   }
   return prefix + "/src/google/protobuf/compiler/ruby";
   return prefix + "/src/google/protobuf/compiler/ruby";
+#else
+  return "third_party/protobuf/src/google/protobuf/compiler/ruby";
+#endif  // GOOGLE_THIRD_PARTY_PROTOBUF
 }
 }
 
 
 // This test is a simple golden-file test over the output of the Ruby code
 // This test is a simple golden-file test over the output of the Ruby code