From a9332e201d246c0f6076a6821893b141967a056b Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Mon, 25 May 2015 16:04:36 -0700 Subject: 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 --- .../protobuf/compiler/ruby/ruby_generator_unittest.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc') 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); -- cgit v1.2.3