aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2015-05-25 16:04:36 -0700
committerGravatar Bo Yang <teboring@google.com>2015-05-25 16:04:36 -0700
commita9332e201d246c0f6076a6821893b141967a056b (patch)
tree54ce8ea859301ccc6c75f7752d1db23f37194eb2 /src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
parenteef79f3ef0fa306a826043a6fb2be39fe989d231 (diff)
Copy two data files from ruby/tests to src/google/compiler/ruby. Tests in src/google/compiler/ruby depend on these two files, but they were missed in language distributions other than ruby
Diffstat (limited to 'src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
index e35ca695..0247e95f 100644
--- a/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
+++ b/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
@@ -48,7 +48,7 @@ namespace {
string FindRubyTestDir() {
// Inspired by TestSourceDir() in src/google/protobuf/testing/googletest.cc.
string prefix = ".";
- while (!File::Exists(prefix + "/ruby/tests")) {
+ while (!File::Exists(prefix + "/src/google/protobuf/compiler/ruby")) {
if (!File::Exists(prefix)) {
GOOGLE_LOG(FATAL)
<< "Could not find Ruby test directory. Please run tests from "
@@ -56,7 +56,7 @@ string FindRubyTestDir() {
}
prefix += "/..";
}
- return prefix + "/ruby/tests";
+ return prefix + "/src/google/protobuf/compiler/ruby";
}
// This test is a simple golden-file test over the output of the Ruby code
@@ -78,11 +78,11 @@ TEST(RubyGeneratorTest, GeneratorTest) {
// Copy generated_code.proto to the temporary test directory.
string test_input;
GOOGLE_CHECK_OK(File::GetContents(
- ruby_tests + "/generated_code.proto",
+ ruby_tests + "/ruby_generated_code.proto",
&test_input,
true));
GOOGLE_CHECK_OK(File::SetContents(
- TestTempDir() + "/generated_code.proto",
+ TestTempDir() + "/ruby_generated_code.proto",
test_input,
true));
@@ -93,7 +93,7 @@ TEST(RubyGeneratorTest, GeneratorTest) {
"protoc",
ruby_out.c_str(),
proto_path.c_str(),
- "generated_code.proto",
+ "ruby_generated_code.proto",
};
EXPECT_EQ(0, cli.Run(4, argv));
@@ -101,12 +101,12 @@ TEST(RubyGeneratorTest, GeneratorTest) {
// Load the generated output and compare to the expected result.
string output;
GOOGLE_CHECK_OK(File::GetContents(
- TestTempDir() + "/generated_code.rb",
+ TestTempDir() + "/ruby_generated_code.rb",
&output,
true));
string expected_output;
GOOGLE_CHECK_OK(File::GetContents(
- ruby_tests + "/generated_code.rb",
+ ruby_tests + "/ruby_generated_code.rb",
&expected_output,
true));
EXPECT_EQ(expected_output, output);