diff options
author | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-08-05 20:18:53 +0000 |
---|---|---|
committer | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-08-05 20:18:53 +0000 |
commit | abe61de6e62aecbdf342204a89c56b03f3e45745 (patch) | |
tree | 438890edd73b02bf7277d2c5abaf6b3db136198a /src | |
parent | 91e32ac64dc63417ca5ce81475f88e85994aacf3 (diff) | |
download | protobuf-abe61de6e62aecbdf342204a89c56b03f3e45745.tar.gz protobuf-abe61de6e62aecbdf342204a89c56b03f3e45745.tar.bz2 protobuf-abe61de6e62aecbdf342204a89c56b03f3e45745.zip |
make changes to pass Cygwin
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/compiler/command_line_interface_unittest.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc index 9e244da3..5dc4a527 100644 --- a/src/google/protobuf/compiler/command_line_interface_unittest.cc +++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc @@ -85,7 +85,7 @@ class CommandLineInterfaceTest : public testing::Test { // Runs the CommandLineInterface with the given command line. The // command is automatically split on spaces, and the string "$tmpdir" // is replaced with TestTempDir(). - void Run(const string& command); + void Run(const string& command, bool capture_stdout = false); // ----------------------------------------------------------------- // Methods to set up the test (called before Run()). @@ -261,7 +261,7 @@ void CommandLineInterfaceTest::TearDown() { mock_generators_to_delete_.clear(); } -void CommandLineInterfaceTest::Run(const string& command) { +void CommandLineInterfaceTest::Run(const string& command, bool capture_stdout) { vector<string> args = Split(command, " ", true); if (!disallow_plugins_) { @@ -308,13 +308,17 @@ void CommandLineInterfaceTest::Run(const string& command) { argv[i] = args[i].c_str(); } - CaptureTestStdout(); + if (capture_stdout) { + CaptureTestStdout(); + } CaptureTestStderr(); return_code_ = cli_.Run(args.size(), argv.get()); error_text_ = GetCapturedTestStderr(); - captured_stdout_ = GetCapturedTestStdout(); + if (capture_stdout) { + captured_stdout_ = GetCapturedTestStdout(); + } } // ------------------------------------------------------------------- @@ -1461,7 +1465,7 @@ TEST_F(CommandLineInterfaceTest, PrintFreeFieldNumbers) { "}\n"); Run("protocol_compiler --print_free_field_numbers --proto_path=$tmpdir " - "foo.proto bar.proto baz.proto quz.proto"); + "foo.proto bar.proto baz.proto quz.proto", true); ExpectNoErrors(); ExpectCapturedStdout( |