Generate C# conformance test in script

This is already generated code, but wasn't included in our generation script.
This change makes sure it will be up-to-date, and uses the now-conventional .pb.cs file extension.

This does *not* affect the conformance tests run from Bazel, as they generate the file separately and build the conformance tests using only Program.cs and the freshly-generated code.
However, the csharp/src/Google.Protobuf.Conformance/BUILD.bazel still needs to be kept up-to-date with the filename change.
pull/11880/head
Jon Skeet 2 years ago
parent d2c6d5efd4
commit 34bb22cc46
  1. 5
      csharp/generate_protos.sh
  2. 4
      csharp/src/Google.Protobuf.Conformance/BUILD.bazel
  3. 107
      csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs

@ -79,3 +79,8 @@ $PROTOC -Isrc -I. \
$PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \
--csharp_opt=file_extension=.pb.cs \
examples/addressbook.proto
# Conformance tests
$PROTOC -I. --csharp_out=csharp/src/Google.Protobuf.Conformance \
--csharp_opt=file_extension=.pb.cs \
conformance/conformance.proto

@ -37,7 +37,7 @@ CONFORMANCE_DEPS = [
filegroup(
name = "srcs",
srcs = [
"Conformance.cs",
"Conformance.pb.cs",
"Program.cs",
"Google.Protobuf.Conformance.csproj",
],
@ -88,7 +88,7 @@ pkg_files(
srcs = [
"BUILD.bazel",
"Google.Protobuf.Conformance.csproj",
"Conformance.cs",
"Conformance.pb.cs",
"Program.cs",
],
strip_prefix = strip_prefix.from_root(""),

@ -1,6 +1,6 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: conformance.proto
// source: conformance/conformance.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code
@ -11,11 +11,11 @@ using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Conformance {
/// <summary>Holder for reflection information generated from conformance.proto</summary>
/// <summary>Holder for reflection information generated from conformance/conformance.proto</summary>
public static partial class ConformanceReflection {
#region Descriptor
/// <summary>File descriptor for conformance.proto</summary>
/// <summary>File descriptor for conformance/conformance.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
@ -24,34 +24,35 @@ namespace Conformance {
static ConformanceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"ChFjb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2UiHQoKRmFpbHVyZVNl",
"dBIPCgdmYWlsdXJlGAEgAygJIuMCChJDb25mb3JtYW5jZVJlcXVlc3QSGgoQ",
"cHJvdG9idWZfcGF5bG9hZBgBIAEoDEgAEhYKDGpzb25fcGF5bG9hZBgCIAEo",
"CUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRleHRfcGF5bG9hZBgI",
"IAEoCUgAEjgKF3JlcXVlc3RlZF9vdXRwdXRfZm9ybWF0GAMgASgOMhcuY29u",
"Zm9ybWFuY2UuV2lyZUZvcm1hdBIUCgxtZXNzYWdlX3R5cGUYBCABKAkSMAoN",
"dGVzdF9jYXRlZ29yeRgFIAEoDjIZLmNvbmZvcm1hbmNlLlRlc3RDYXRlZ29y",
"eRI+ChVqc3BiX2VuY29kaW5nX29wdGlvbnMYBiABKAsyHy5jb25mb3JtYW5j",
"ZS5Kc3BiRW5jb2RpbmdDb25maWcSHAoUcHJpbnRfdW5rbm93bl9maWVsZHMY",
"CSABKAhCCQoHcGF5bG9hZCLhAQoTQ29uZm9ybWFuY2VSZXNwb25zZRIVCgtw",
"YXJzZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6ZV9lcnJvchgGIAEoCUgA",
"EhcKDXJ1bnRpbWVfZXJyb3IYAiABKAlIABIaChBwcm90b2J1Zl9wYXlsb2Fk",
"GAMgASgMSAASFgoManNvbl9wYXlsb2FkGAQgASgJSAASEQoHc2tpcHBlZBgF",
"IAEoCUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRleHRfcGF5bG9h",
"ZBgIIAEoCUgAQggKBnJlc3VsdCI3ChJKc3BiRW5jb2RpbmdDb25maWcSIQoZ",
"dXNlX2pzcGJfY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ZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6ZV9l",
"cnJvchgGIAEoCUgAEhcKDXRpbWVvdXRfZXJyb3IYCSABKAlIABIXCg1ydW50",
"aW1lX2Vycm9yGAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgA",
"EhYKDGpzb25fcGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIABIW",
"Cgxqc3BiX3BheWxvYWQYByABKAlIABIWCgx0ZXh0X3BheWxvYWQYCCABKAlI",
"AEIICgZyZXN1bHQiNwoSSnNwYkVuY29kaW5nQ29uZmlnEiEKGXVzZV9qc3Bi",
"X2FycmF5X2FueV9mb3JtYXQYASABKAgqUAoKV2lyZUZvcm1hdBIPCgtVTlNQ",
"RUNJRklFRBAAEgwKCFBST1RPQlVGEAESCAoESlNPThACEggKBEpTUEIQAxIP",
"CgtURVhUX0ZPUk1BVBAEKo8BCgxUZXN0Q2F0ZWdvcnkSFAoQVU5TUEVDSUZJ",
"RURfVEVTVBAAEg8KC0JJTkFSWV9URVNUEAESDQoJSlNPTl9URVNUEAISJAog",
"SlNPTl9JR05PUkVfVU5LTk9XTl9QQVJTSU5HX1RFU1QQAxINCglKU1BCX1RF",
"U1QQBBIUChBURVhUX0ZPUk1BVF9URVNUEAVCLwofY29tLmdvb2dsZS5wcm90",
"b2J1Zi5jb25mb3JtYW5jZaICC0NvbmZvcm1hbmNlYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Conformance.WireFormat), typeof(global::Conformance.TestCategory), }, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.FailureSet), global::Conformance.FailureSet.Parser, new[]{ "Failure" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceRequest), global::Conformance.ConformanceRequest.Parser, new[]{ "ProtobufPayload", "JsonPayload", "JspbPayload", "TextPayload", "RequestedOutputFormat", "MessageType", "TestCategory", "JspbEncodingOptions", "PrintUnknownFields" }, new[]{ "Payload" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped", "JspbPayload", "TextPayload" }, new[]{ "Result" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.ConformanceResponse), global::Conformance.ConformanceResponse.Parser, new[]{ "ParseError", "SerializeError", "TimeoutError", "RuntimeError", "ProtobufPayload", "JsonPayload", "Skipped", "JspbPayload", "TextPayload" }, new[]{ "Result" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.JspbEncodingConfig), global::Conformance.JspbEncodingConfig.Parser, new[]{ "UseJspbArrayAnyFormat" }, null, null, null, null)
}));
}
@ -89,7 +90,8 @@ namespace Conformance {
/// </summary>
[pbr::OriginalName("JSON_IGNORE_UNKNOWN_PARSING_TEST")] JsonIgnoreUnknownParsingTest = 3,
/// <summary>
/// Test jspb wire format. Only used inside Google. Opensource testees just skip it.
/// Test jspb wire format. Only used inside Google. Opensource testees just
/// skip it.
/// </summary>
[pbr::OriginalName("JSPB_TEST")] JspbTest = 4,
/// <summary>
@ -382,7 +384,7 @@ namespace Conformance {
/// <summary>Field number for the "jspb_payload" field.</summary>
public const int JspbPayloadFieldNumber = 7;
/// <summary>
/// Only used inside google. Opensource testees just skip it.
/// Only used inside Google. Opensource testees just skip it.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@ -443,8 +445,8 @@ namespace Conformance {
private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest;
/// <summary>
/// Each test is given a specific test category. Some category may need
/// specific support in testee programs. Refer to the definition of TestCategory
/// for more information.
/// specific support in testee programs. Refer to the definition of
/// TestCategory for more information.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@ -892,6 +894,9 @@ namespace Conformance {
case ResultOneofCase.SerializeError:
SerializeError = other.SerializeError;
break;
case ResultOneofCase.TimeoutError:
TimeoutError = other.TimeoutError;
break;
case ResultOneofCase.RuntimeError:
RuntimeError = other.RuntimeError;
break;
@ -957,6 +962,23 @@ namespace Conformance {
}
}
/// <summary>Field number for the "timeout_error" field.</summary>
public const int TimeoutErrorFieldNumber = 9;
/// <summary>
/// This should be set if the test program timed out. The string should
/// provide more information about what the child process was doing when it
/// was killed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string TimeoutError {
get { return resultCase_ == ResultOneofCase.TimeoutError ? (string) result_ : ""; }
set {
result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
resultCase_ = ResultOneofCase.TimeoutError;
}
}
/// <summary>Field number for the "runtime_error" field.</summary>
public const int RuntimeErrorFieldNumber = 2;
/// <summary>
@ -1061,6 +1083,7 @@ namespace Conformance {
None = 0,
ParseError = 1,
SerializeError = 6,
TimeoutError = 9,
RuntimeError = 2,
ProtobufPayload = 3,
JsonPayload = 4,
@ -1099,6 +1122,7 @@ namespace Conformance {
}
if (ParseError != other.ParseError) return false;
if (SerializeError != other.SerializeError) return false;
if (TimeoutError != other.TimeoutError) return false;
if (RuntimeError != other.RuntimeError) return false;
if (ProtobufPayload != other.ProtobufPayload) return false;
if (JsonPayload != other.JsonPayload) return false;
@ -1115,6 +1139,7 @@ namespace Conformance {
int hash = 1;
if (resultCase_ == ResultOneofCase.ParseError) hash ^= ParseError.GetHashCode();
if (resultCase_ == ResultOneofCase.SerializeError) hash ^= SerializeError.GetHashCode();
if (resultCase_ == ResultOneofCase.TimeoutError) hash ^= TimeoutError.GetHashCode();
if (resultCase_ == ResultOneofCase.RuntimeError) hash ^= RuntimeError.GetHashCode();
if (resultCase_ == ResultOneofCase.ProtobufPayload) hash ^= ProtobufPayload.GetHashCode();
if (resultCase_ == ResultOneofCase.JsonPayload) hash ^= JsonPayload.GetHashCode();
@ -1172,6 +1197,10 @@ namespace Conformance {
output.WriteRawTag(66);
output.WriteString(TextPayload);
}
if (resultCase_ == ResultOneofCase.TimeoutError) {
output.WriteRawTag(74);
output.WriteString(TimeoutError);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@ -1214,6 +1243,10 @@ namespace Conformance {
output.WriteRawTag(66);
output.WriteString(TextPayload);
}
if (resultCase_ == ResultOneofCase.TimeoutError) {
output.WriteRawTag(74);
output.WriteString(TimeoutError);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
@ -1230,6 +1263,9 @@ namespace Conformance {
if (resultCase_ == ResultOneofCase.SerializeError) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(SerializeError);
}
if (resultCase_ == ResultOneofCase.TimeoutError) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(TimeoutError);
}
if (resultCase_ == ResultOneofCase.RuntimeError) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(RuntimeError);
}
@ -1267,6 +1303,9 @@ namespace Conformance {
case ResultOneofCase.SerializeError:
SerializeError = other.SerializeError;
break;
case ResultOneofCase.TimeoutError:
TimeoutError = other.TimeoutError;
break;
case ResultOneofCase.RuntimeError:
RuntimeError = other.RuntimeError;
break;
@ -1334,6 +1373,10 @@ namespace Conformance {
TextPayload = input.ReadString();
break;
}
case 74: {
TimeoutError = input.ReadString();
break;
}
}
}
#endif
@ -1381,6 +1424,10 @@ namespace Conformance {
TextPayload = input.ReadString();
break;
}
case 74: {
TimeoutError = input.ReadString();
break;
}
}
}
}
Loading…
Cancel
Save