diff options
author | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
commit | 92a7e778e7394386f413cec28d67a07630f784b1 (patch) | |
tree | cb5673c7c09b0d3905b48a24765d07e423bc5b30 /src/google/protobuf/compiler/annotation_test_util.cc | |
parent | ce0a53273a400369932ba788d17500336a6ecaad (diff) |
Integrated internal changes from Google
Diffstat (limited to 'src/google/protobuf/compiler/annotation_test_util.cc')
-rw-r--r-- | src/google/protobuf/compiler/annotation_test_util.cc | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/google/protobuf/compiler/annotation_test_util.cc b/src/google/protobuf/compiler/annotation_test_util.cc index aa14faf6..cc8534cc 100644 --- a/src/google/protobuf/compiler/annotation_test_util.cc +++ b/src/google/protobuf/compiler/annotation_test_util.cc @@ -76,10 +76,9 @@ void AddFile(const string& filename, const string& data) { true)); } -bool CaptureMetadata(const string& filename, const string& plugin_specific_args, - const string& meta_file_suffix, CommandLineInterface* cli, - FileDescriptorProto* file, - std::vector<ExpectedOutput>* outputs) { +bool RunProtoCompiler(const string& filename, + const string& plugin_specific_args, + CommandLineInterface* cli, FileDescriptorProto* file) { cli->SetInputsAreProtoPathRelative(true); DescriptorCapturingGenerator capturing_generator(file); @@ -92,24 +91,7 @@ bool CaptureMetadata(const string& filename, const string& plugin_specific_args, plugin_specific_args.c_str(), capture_out.c_str(), filename.c_str()}; - if (cli->Run(5, argv) != 0) { - return false; - } - - if (outputs != NULL) { - for (std::vector<ExpectedOutput>::iterator i = outputs->begin(); - i != outputs->end(); ++i) { - GOOGLE_CHECK_OK(File::GetContents(TestTempDir() + "/" + i->file_path, - &i->file_content, true)); - if (!DecodeMetadata( - TestTempDir() + "/" + i->file_path + meta_file_suffix, - &i->file_info)) { - return false; - } - } - } - - return true; + return cli->Run(5, argv) == 0; } bool DecodeMetadata(const string& path, GeneratedCodeInfo* info) { |