aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2015-05-26 14:13:53 -0700
committerBo Yang <teboring@google.com>2015-05-26 14:13:53 -0700
commit83d334f713b814dfff2d76e189a8245c8e296792 (patch)
tree2cdc1e4fb444f5b230e02f964502e63e1fa35683
parent3a5455b34bbe7f137ac22e07929d6b88098f6b64 (diff)
downloadprotobuf-83d334f713b814dfff2d76e189a8245c8e296792.tar.gz
protobuf-83d334f713b814dfff2d76e189a8245c8e296792.tar.bz2
protobuf-83d334f713b814dfff2d76e189a8245c8e296792.zip
When doing make distcheck, a src/google/protobuf/compiler/ruby is created to
put built libraries. This directory hides the one that contains ruby_generated_code.proto and ruby_generated_code.rb.
-rw-r--r--src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
index 0247e95f..6c203ab6 100644
--- a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
+++ b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
@@ -45,10 +45,10 @@ namespace compiler {
namespace ruby {
namespace {
-string FindRubyTestDir() {
+string FindRubyTestDir(const string& file) {
// Inspired by TestSourceDir() in src/google/protobuf/testing/googletest.cc.
string prefix = ".";
- while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby")) {
+ while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby" + file)) {
if (!File::Exists(prefix)) {
GOOGLE_LOG(FATAL)
<< "Could not find Ruby test directory. Please run tests from "
@@ -67,7 +67,7 @@ string FindRubyTestDir() {
// extensions to the point where we can do this test in a more automated way.
TEST(RubyGeneratorTest, GeneratorTest) {
- string ruby_tests = FindRubyTestDir();
+ string ruby_tests = FindRubyTestDir("/ruby_generated_code.proto");
google::protobuf::compiler::CommandLineInterface cli;
cli.SetInputsAreProtoPathRelative(true);