Down-integrate internal changes (#5467)
* Down-integrate internal changes
* Update generated code for php, objc and csharp.
* Add missing dependency in conformance_php
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h
index d5c2f3d..ab82bbe 100644
--- a/conformance/conformance_test.h
+++ b/conformance/conformance_test.h
@@ -87,7 +87,6 @@
static int Run(int argc, char *argv[],
ConformanceTestSuite* suite);
- private:
ForkPipeRunner(const std::string &executable)
: child_pid_(-1), executable_(executable) {}
@@ -97,24 +96,7 @@
const std::string& request,
std::string* response);
- // TODO(haberman): make this work on Windows, instead of using these
- // UNIX-specific APIs.
- //
- // There is a platform-agnostic API in
- // src/google/protobuf/compiler/subprocess.h
- //
- // However that API only supports sending a single message to the subprocess.
- // We really want to be able to send messages and receive responses one at a
- // time:
- //
- // 1. Spawning a new process for each test would take way too long for thousands
- // of tests and subprocesses like java that can take 100ms or more to start
- // up.
- //
- // 2. Sending all the tests in one big message and receiving all results in one
- // big message would take away our visibility about which test(s) caused a
- // crash or other fatal error. It would also give us only a single failure
- // instead of all of them.
+ private:
void SpawnTestProgram();
void CheckedWrite(int fd, const void *buf, size_t len);
@@ -237,6 +219,7 @@
protected:
virtual string InputFormatString(conformance::WireFormat format) const;
virtual string OutputFormatString(conformance::WireFormat format) const;
+ conformance::ConformanceRequest request_;
private:
ConformanceLevel level_;
@@ -244,11 +227,24 @@
::conformance::WireFormat output_format_;
const Message& prototype_message_;
string test_name_;
- conformance::ConformanceRequest request_;
};
bool CheckSetEmpty(const std::set<string>& set_to_check,
const std::string& write_to_file, const std::string& msg);
+ string WireFormatToString(conformance::WireFormat wire_format);
+
+ // Parse payload in the response to the given message. Returns true on
+ // success.
+ virtual bool ParseResponse(
+ const conformance::ConformanceResponse& response,
+ const ConformanceRequestSetting& setting,
+ Message* test_message) = 0;
+
+ void VerifyResponse(
+ const ConformanceRequestSetting& setting,
+ const string& equivalent_wire_format,
+ const conformance::ConformanceResponse& response,
+ bool need_report_success);
void ReportSuccess(const std::string& test_name);
void ReportFailure(const string& test_name,
@@ -295,10 +291,6 @@
// The set of tests that the testee opted out of;
std::set<std::string> skipped_;
-
- std::unique_ptr<google::protobuf::util::TypeResolver>
- type_resolver_;
- std::string type_url_;
};
} // namespace protobuf