aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/command_line_interface_unittest.cc
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
commit5f12164f54a12500d2d8276937b7ed4fec408b99 (patch)
tree5cce5fcecb4a3104ca33fd67e1d37f788b719576 /src/google/protobuf/compiler/command_line_interface_unittest.cc
parent46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 (diff)
downloadprotobuf-5f12164f54a12500d2d8276937b7ed4fec408b99.tar.gz
protobuf-5f12164f54a12500d2d8276937b7ed4fec408b99.tar.bz2
protobuf-5f12164f54a12500d2d8276937b7ed4fec408b99.zip
Refactor the way output is handled in CommandLineInterface -- now it will be stored in-memory until all code generators have completed, then dumped to disk all at once. While this means that protoc uses more memory, the code is much simpler, and handles insertions much faster. Also, this made it easier to implement a useful feature: insertions will be indented to match the insertion point line. Therefore, when inserting into Python code, you don't have to figure out how much to indent your inserted code. The refactoring should also make it easier to implement output-to-jar at some point.
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface_unittest.cc')
-rw-r--r--src/google/protobuf/compiler/command_line_interface_unittest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface_unittest.cc b/src/google/protobuf/compiler/command_line_interface_unittest.cc
index 2ea48b7e..9129ebf0 100644
--- a/src/google/protobuf/compiler/command_line_interface_unittest.cc
+++ b/src/google/protobuf/compiler/command_line_interface_unittest.cc
@@ -933,7 +933,10 @@ TEST_F(CommandLineInterfaceTest, OutputWriteError) {
Run("protocol_compiler --test_out=$tmpdir "
"--proto_path=$tmpdir foo.proto");
- ExpectErrorSubstring("MockCodeGenerator detected write error.");
+ // MockCodeGenerator no longer detects an error because we actually write to
+ // an in-memory location first, then dump to disk at the end. This is no
+ // big deal.
+ // ExpectErrorSubstring("MockCodeGenerator detected write error.");
#if defined(_WIN32) && !defined(__CYGWIN__)
// Windows with MSVCRT.dll produces EPERM instead of EISDIR.