diff options
Diffstat (limited to 'src/google/protobuf/compiler/annotation_test_util.cc')
-rw-r--r-- | src/google/protobuf/compiler/annotation_test_util.cc | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/src/google/protobuf/compiler/annotation_test_util.cc b/src/google/protobuf/compiler/annotation_test_util.cc index aa14faf6..a0530b9a 100644 --- a/src/google/protobuf/compiler/annotation_test_util.cc +++ b/src/google/protobuf/compiler/annotation_test_util.cc @@ -31,9 +31,6 @@ #include <google/protobuf/compiler/annotation_test_util.h> #include <memory> -#ifndef _SHARED_PTR_H -#include <google/protobuf/stubs/shared_ptr.h> -#endif #include <google/protobuf/compiler/code_generator.h> #include <google/protobuf/compiler/command_line_interface.h> #include <google/protobuf/io/printer.h> @@ -76,10 +73,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 +88,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) { |