Skip to content

Commit 428409d

Browse files
ericsalocopybara-github
authored andcommitted
protobuf: add support for Go prototiller in codegen tests
PiperOrigin-RevId: 941394877
1 parent e1b94ce commit 428409d

6 files changed

Lines changed: 158 additions & 39 deletions

editions/golden/compare_cpp_codegen_failure.txt

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
1+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go)
22
@@ @@
33
::_pbi::TcParser::GetTable<::protobuf_editions_test::golden::SimpleProto3>(), // to_prefetch
44
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
@@ -34,8 +34,65 @@
3434
cached_has_bits = this_._impl_._has_bits_[0];
3535
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
3636
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
37-
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
38-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h
37+
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go)
38+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java)
39+
@@ @@
40+
::_pbi::TcParser::GetTable<::protobuf_editions_test::golden::SimpleProto3>(), // to_prefetch
41+
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
42+
}, {{
43+
- // optional int32 int32_field = 1;
44+
+ // int32 int32_field = 1;
45+
{::_pbi::TcParser::FastV32S1,
46+
{8, 0, 0,
47+
PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}},
48+
}}, {{
49+
65535, 65535
50+
}}, {{
51+
- // optional int32 int32_field = 1;
52+
+ // int32 int32_field = 1;
53+
{PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
54+
}},
55+
// no aux_entries
56+
@@ @@
57+
(void)cached_has_bits;
58+
59+
cached_has_bits = this_._impl_._has_bits_[0];
60+
- // optional int32 int32_field = 1;
61+
+ // int32 int32_field = 1;
62+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
63+
target =
64+
::proto2::internal::WireFormatLite::WriteInt32ToArrayWithField<1>(
65+
@@ @@
66+
::uint32_t cached_has_bits [[maybe_unused]] = 0;
67+
68+
{
69+
- // optional int32 int32_field = 1;
70+
+ // int32 int32_field = 1;
71+
cached_has_bits = this_._impl_._has_bits_[0];
72+
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
73+
total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
74+
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java)
75+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go)
76+
@@ @@
77+
enum : int {
78+
kInt32FieldFieldNumber = 1,
79+
};
80+
- // optional int32 int32_field = 1;
81+
+ // int32 int32_field = 1;
82+
[[nodiscard]] bool has_int32_field() const;
83+
void clear_int32_field() ;
84+
[[nodiscard]] ::int32_t int32_field() const;
85+
@@ @@
86+
87+
// SimpleProto3
88+
89+
-// optional int32 int32_field = 1;
90+
+// int32 int32_field = 1;
91+
inline bool SimpleProto3::has_int32_field() const {
92+
bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U);
93+
return value;
94+
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go)
95+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java)
3996
@@ @@
4097
enum : int {
4198
kInt32FieldFieldNumber = 1,
@@ -54,6 +111,10 @@
54111
inline bool SimpleProto3::has_int32_field() const {
55112
bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U);
56113
return value;
57-
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h
58-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h
59-
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h
114+
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java)
115+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go)
116+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go)
117+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java)
118+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java)
119+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence)
120+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence)
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testsuites tests="1" name="AllTests">
2+
<testsuites tests="3" name="AllTests">
33
<testsuite name="EditionsCodegenTests">
4-
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.cc" status="run" result="completed" classname="DiffTest">
4+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go)" status="run" result="completed" classname="DiffTest">
55
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.cc&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;&#x0A;#include &quot;third_party/protobuf/editions/golden/simple_proto3.pb.h&quot;&#x0A;&#x0A;#include &lt;algorithm&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_impl.h&quot;&#x0A;#include &quot;third_party/protobuf/internal_visibility.h&quot;&#x0A;#include &quot;third_party/protobuf/extension_set.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/wire_format_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/io/zero_copy_stream_impl_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;, with the difference:&#x0A;@@ @@&#x0A; ::_pbi::TcParser::GetTable&lt;::protobuf_editions_test::golden::SimpleProto3&gt;(), // to_prefetch&#x0A; #endif // PROTOBUF_PREFETCH_PARSE_TABLE&#x0A; }, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {::_pbi::TcParser::FastV32S1,&#x0A; {8, 0, 0,&#x0A; PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}},&#x0A; }}, {{&#x0A; 65535, 65535&#x0A; }}, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},&#x0A; }},&#x0A; // no aux_entries&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; cached_has_bits = this_._impl_._has_bits_[0];&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; if (CheckHasBit(cached_has_bits, 0x00000001U)) {&#x0A; target =&#x0A; ::proto2::internal::WireFormatLite::WriteInt32ToArrayWithField&lt;1&gt;(&#x0A;@@ @@&#x0A; ::uint32_t cached_has_bits [[maybe_unused]] = 0;&#x0A; &#x0A; {&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; cached_has_bits = this_._impl_._has_bits_[0];&#x0A; if (CheckHasBit(cached_has_bits, 0x00000001U)) {&#x0A; total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(" type=""></failure>
66
</testcase>
7-
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.h" status="run" result="completed" classname="DiffTest">
7+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java)" status="run" result="completed" classname="DiffTest">
8+
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.cc&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;&#x0A;#include &quot;third_party/protobuf/editions/golden/simple_proto3.pb.h&quot;&#x0A;&#x0A;#include &lt;algorithm&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_impl.h&quot;&#x0A;#include &quot;third_party/protobuf/internal_visibility.h&quot;&#x0A;#include &quot;third_party/protobuf/extension_set.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/wire_format_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/io/zero_copy_stream_impl_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;, with the difference:&#x0A;@@ @@&#x0A; ::_pbi::TcParser::GetTable&lt;::protobuf_editions_test::golden::SimpleProto3&gt;(), // to_prefetch&#x0A; #endif // PROTOBUF_PREFETCH_PARSE_TABLE&#x0A; }, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {::_pbi::TcParser::FastV32S1,&#x0A; {8, 0, 0,&#x0A; PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_)}},&#x0A; }}, {{&#x0A; 65535, 65535&#x0A; }}, {{&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; {PROTOBUF_FIELD_OFFSET(SimpleProto3, _impl_.int32_field_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},&#x0A; }},&#x0A; // no aux_entries&#x0A;@@ @@&#x0A; (void)cached_has_bits;&#x0A; &#x0A; cached_has_bits = this_._impl_._has_bits_[0];&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; if (CheckHasBit(cached_has_bits, 0x00000001U)) {&#x0A; target =&#x0A; ::proto2::internal::WireFormatLite::WriteInt32ToArrayWithField&lt;1&gt;(&#x0A;@@ @@&#x0A; ::uint32_t cached_has_bits [[maybe_unused]] = 0;&#x0A; &#x0A; {&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; cached_has_bits = this_._impl_._has_bits_[0];&#x0A; if (CheckHasBit(cached_has_bits, 0x00000001U)) {&#x0A; total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(" type=""></failure>
9+
</testcase>
10+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.h (Go)" status="run" result="completed" classname="DiffTest">
11+
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.h&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;&#x0A;#ifndef third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;#define third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;&#x0A;#include &lt;limits&gt;&#x0A;#include &lt;string&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &lt;utility&gt;&#x0A;&#x0A;// clang-format off&#x0A;#include &quot;third_party/protobuf/runtime_version.h&quot;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/arena.h&quot;&#x0A;#include &quot;third_party/protobuf/arenastring.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_decl.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/metadata_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/message_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;// clang-format on&#x0A;&#x0A;#endif // third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;, with the difference:&#x0A;@@ @@&#x0A; enum : int {&#x0A; kInt32FieldFieldNumber = 1,&#x0A; };&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; [[nodiscard]] bool has_int32_field() const;&#x0A; void clear_int32_field() ;&#x0A; [[nodiscard]] ::int32_t int32_field() const;&#x0A;@@ @@&#x0A; &#x0A; // SimpleProto3&#x0A; &#x0A;-// optional int32 int32_field = 1;&#x0A;+// int32 int32_field = 1;&#x0A; inline bool SimpleProto3::has_int32_field() const {&#x0A; bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U);&#x0A; return value;" type=""></failure>
12+
</testcase>
13+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.pb.h (Java)" status="run" result="completed" classname="DiffTest">
814
<failure message="Value of: third_party/protobuf/editions/golden/simple_proto3.pb.h&#x0A;Expected: &#x0A;// Generated by the protocol buffer compiler. DO NOT EDIT!&#x0A;// NO CHECKED-IN PROTOBUF GENCODE&#x0A;// source: third_party/protobuf/editions/golden/simple_proto3.proto&#x0A;&#x0A;#ifndef third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;#define third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;&#x0A;#include &lt;limits&gt;&#x0A;#include &lt;string&gt;&#x0A;#include &lt;type_traits&gt;&#x0A;#include &lt;utility&gt;&#x0A;&#x0A;// clang-format off&#x0A;#include &quot;third_party/protobuf/runtime_version.h&quot;&#x0A;#include &quot;third_party/protobuf/io/coded_stream.h&quot;&#x0A;#include &quot;third_party/protobuf/arena.h&quot;&#x0A;#include &quot;third_party/protobuf/arenastring.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_tctable_decl.h&quot;&#x0A;#include &quot;third_party/protobuf/generated_message_util.h&quot;&#x0A;#include &quot;third_party/protobuf/metadata_lite.h&quot;&#x0A;#include &quot;third_party/protobuf/message_lite.h&quot;&#x0A;// @@protoc_insertion_point(includes)&#x0A;&#x0A;// Must be included last.&#x0A;// clang-format on&#x0A;&#x0A;#endif // third_5fparty_2fprotobuf_2feditions_2fgolden_2fsimple_5fproto3_2eproto_2epb_2eh&#x0A;, with the difference:&#x0A;@@ @@&#x0A; enum : int {&#x0A; kInt32FieldFieldNumber = 1,&#x0A; };&#x0A;- // optional int32 int32_field = 1;&#x0A;+ // int32 int32_field = 1;&#x0A; [[nodiscard]] bool has_int32_field() const;&#x0A; void clear_int32_field() ;&#x0A; [[nodiscard]] ::int32_t int32_field() const;&#x0A;@@ @@&#x0A; &#x0A; // SimpleProto3&#x0A; &#x0A;-// optional int32 int32_field = 1;&#x0A;+// int32 int32_field = 1;&#x0A; inline bool SimpleProto3::has_int32_field() const {&#x0A; bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U);&#x0A; return value;" type=""></failure>
915
</testcase>
10-
<testcase name="third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h" status="run" result="completed" classname="DiffTest">
16+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go)" status="run" result="completed" classname="DiffTest">
17+
</testcase>
18+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java)" status="run" result="completed" classname="DiffTest">
19+
</testcase>
20+
<testcase name="third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence)" status="run" result="completed" classname="EquivalenceTest">
1121
</testcase>
1222
</testsuite>
1323
</testsuites>
Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc
2-
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc
3-
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h
4-
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h
5-
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h
6-
[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h
7-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
8-
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
9-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h
10-
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h
11-
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h
12-
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h
1+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Go)
2+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Go)
3+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Java)
4+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.cc (Java)
5+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Go)
6+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Go)
7+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Java)
8+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.pb.h (Java)
9+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Go)
10+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Go)
11+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Java)
12+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto.static_reflection.h (Java)
13+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go)
14+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Go)
15+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java)
16+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.cc (Java)
17+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go)
18+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Go)
19+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java)
20+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.pb.h (Java)
21+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go)
22+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Go)
23+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java)
24+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto.static_reflection.h (Java)
25+
[ RUN ] third_party/protobuf/editions/golden/simple_proto2.proto (Go vs Java Equivalence)
26+
[ OK ] third_party/protobuf/editions/golden/simple_proto2.proto (Go vs Java Equivalence)
27+
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence)
28+
[ OK ] third_party/protobuf/editions/golden/simple_proto3.proto (Go vs Java Equivalence)

0 commit comments

Comments
 (0)