Skip to content

Commit

Permalink
Merge pull request #488 from AustinSchuh/ruby_test_fix
Browse files Browse the repository at this point in the history
Modified FindRubyTestDir to use GOOGLE_THIRD_PARTY_PROTOBUF
  • Loading branch information
xfxyjwf committed Jun 15, 2015
2 parents 6f56b1a + 1ecef1a commit 4479076
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
Expand Up @@ -47,6 +47,7 @@ namespace {

string FindRubyTestDir(const string& file) {
// Inspired by TestSourceDir() in src/google/protobuf/testing/googletest.cc.
#ifndef GOOGLE_THIRD_PARTY_PROTOBUF
string prefix = ".";
while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby" + file)) {
if (!File::Exists(prefix)) {
Expand All @@ -57,6 +58,9 @@ string FindRubyTestDir(const string& file) {
prefix += "/..";
}
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
Expand Down

0 comments on commit 4479076

Please sign in to comment.