diff --git a/.github/workflows/test_cpp.yml b/.github/workflows/test_cpp.yml
index 854f93484c..4b36b561c2 100644
--- a/.github/workflows/test_cpp.yml
+++ b/.github/workflows/test_cpp.yml
@@ -31,19 +31,19 @@ jobs:
# Override cases with custom images
- config: { name: "Bazel7", flags: --noenable_bzlmod }
- version: Bazel7
+ cache_key: Bazel7
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-cf84e92285ca133b9c8104ad7b14d70e953cbb8e"
targets: "//src/... //third_party/utf8_range/..."
- config: { name: "Bazel7 with Bzlmod", flags: --enable_bzlmod --enable_workspace }
- version: Bazel7bzlmod
+ cache_key: Bazel7bzlmod
image: "us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-cf84e92285ca133b9c8104ad7b14d70e953cbb8e"
targets: "//src/... //third_party/utf8_range/..."
- config: { name: "TCMalloc" }
- version: TcMalloc
+ cache_key: TcMalloc
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/tcmalloc@sha256:1c5133455481f4d1bb8afa477029604f41f1a3c46cebe4d9958cf1af95b5c87c"
targets: "//src/... //third_party/utf8_range/..."
- config: { name: "aarch64" }
- version: TcMalloc
+ cache_key: TcMalloc
targets: "//src/... //src/google/protobuf/compiler:protoc_aarch64_test //third_party/utf8_range/..."
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:6.3.0-aarch64-68e662b3a56b881804dc4e9d45f949791cbc4b94"
name: Linux ${{ matrix.config.name }}
@@ -58,7 +58,7 @@ jobs:
with:
image: ${{ matrix.image }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
- bazel-cache: cpp_linux/${{ matrix.version }}
+ bazel-cache: cpp_linux/${{ matrix.cache_key }}
bazel: test ${{ matrix.targets }} ${{ matrix.config.flags }}
exclude-targets: ${{ matrix.exclude-targets }}
diff --git a/.github/workflows/test_java.yml b/.github/workflows/test_java.yml
index 64639b9d31..189e5c2907 100644
--- a/.github/workflows/test_java.yml
+++ b/.github/workflows/test_java.yml
@@ -18,31 +18,31 @@ jobs:
matrix:
include:
- name: OpenJDK 8
- version: '8'
+ cache_key: '8'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:8-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
# TODO: b/318555165 - enable the layering check. Currently it does
# not work correctly with the toolchain in this Docker image.
targets: //java/... //java/internal:java_version //compatibility/... --features=-layering_check
- name: OpenJDK 11
- version: '11'
+ cache_key: '11'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:11-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
targets: //java/... //java/internal:java_version //compatibility/...
- name: OpenJDK 17
- version: '17'
+ cache_key: '17'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:17-1fdbb997433cb22c1e49ef75ad374a8d6bb88702
targets: //java/... //java/internal:java_version //compatibility/...
- name: Bazel7
- version: 'bazel7nobzlmod'
+ cache_key: 'bazel7nobzlmod'
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-cf84e92285ca133b9c8104ad7b14d70e953cbb8e
targets: //java/... //java/internal:java_version //compatibility/...
flags: --noenable_bzlmod
- name: Bazel7 with Bzlmod
- version: 'bazel7bzlmod'
+ cache_key: 'bazel7bzlmod'
image: us-docker.pkg.dev/protobuf-build/containers/common/linux/bazel:7.1.2-cf84e92285ca133b9c8104ad7b14d70e953cbb8e
targets: //java/... //java/internal:java_version //compatibility/...
flags: --enable_bzlmod --enable_workspace
- name: aarch64
- version: 'aarch64'
+ cache_key: 'aarch64'
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/emulation:aarch64-63dd26c0c7a808d92673a3e52e848189d4ab0f17
targets: //java/... //compatibility/... //src/google/protobuf/compiler:protoc_aarch64_test
@@ -58,7 +58,7 @@ jobs:
with:
image: ${{ matrix.image }}
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
- bazel-cache: java_linux/${{ matrix.version }}
+ bazel-cache: java_linux/${{ matrix.cache_key }}
bazel: test ${{ matrix.targets }} ${{ matrix.flags }} --test_env=KOKORO_JAVA_VERSION
# TODO restore this test (or a better one) when gRPC has rebuilt with 26.x
diff --git a/.github/workflows/test_objectivec.yml b/.github/workflows/test_objectivec.yml
index 1db6c10c88..ea2726dd62 100644
--- a/.github/workflows/test_objectivec.yml
+++ b/.github/workflows/test_objectivec.yml
@@ -57,8 +57,7 @@ jobs:
-scheme ProtocolBuffers \
-configuration ${{ matrix.xc_config }} \
-destination "${{ matrix.destination }}" \
- test \
- | xcpretty
+ test
- name: Report ccache stats
shell: bash
diff --git a/MODULE.bazel b/MODULE.bazel
index d9340924d3..fa8c7c5a6d 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -13,7 +13,7 @@ module(
# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution
# Thus the highest version in their module graph is resolved.
bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
-bazel_dep(name = "bazel_skylib", version = "1.4.1")
+bazel_dep(name = "bazel_skylib", version = "1.7.0")
bazel_dep(name = "jsoncpp", version = "1.9.5")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_fuzzing", version = "0.5.2")
@@ -27,9 +27,6 @@ bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "zlib", version = "1.3.1")
bazel_dep(name = "bazel_features", version = "1.13.0", repo_name = "proto_bazel_features")
-# TODO: remove after toolchain types are moved to protobuf
-bazel_dep(name = "rules_proto", version = "4.0.0")
-
SUPPORTED_PYTHON_VERSIONS = [
"3.8",
"3.9",
@@ -98,5 +95,7 @@ use_repo(maven, "maven")
# Development dependencies
bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest", dev_dependency = True)
-bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
bazel_dep(name = "rules_buf", version = "0.3.0", dev_dependency = True)
+bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
+# rules_proto are needed for @com_google_protobuf_v25.0 used in //compatibility/... tests
+bazel_dep(name = "rules_proto", version = "4.0.0", dev_dependency = True)
diff --git a/WORKSPACE b/WORKSPACE
index 425ba7f181..0459aff61a 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -41,10 +41,10 @@ http_archive(
http_archive(
name = "com_google_googletest",
- sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565",
- strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558",
+ sha256 = "7315acb6bf10e99f332c8a43f00d5fbb1ee6ca48c52f6b936991b216c586aaad",
+ strip_prefix = "googletest-1.15.0",
urls = [
- "https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz" # 2023-03-16
+ "https://github.com/google/googletest/releases/download/v1.15.0/googletest-1.15.0.tar.gz" # 2024-07-15
],
)
diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel
index 1d6749dd76..d0546f9b30 100644
--- a/bazel/BUILD.bazel
+++ b/bazel/BUILD.bazel
@@ -40,6 +40,7 @@ bzl_library(
deps = [
"//bazel/common:proto_common_bzl",
"//bazel/common:proto_info_bzl",
+ "//bazel/private:toolchain_helpers_bzl",
"@rules_python//python:py_info_bzl",
],
)
diff --git a/bazel/private/BUILD.bazel b/bazel/private/BUILD.bazel
index 1ff703b53d..c90632d7b0 100644
--- a/bazel/private/BUILD.bazel
+++ b/bazel/private/BUILD.bazel
@@ -6,9 +6,14 @@
# https://developers.google.com/open-source/licenses/bsd
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+load("//bazel/private:native_bool_flag.bzl", "native_bool_flag")
licenses(["notice"])
+toolchain_type(
+ name = "proto_toolchain_type",
+)
+
bzl_library(
name = "upb_proto_library_internal_bzl",
srcs = [
@@ -39,6 +44,11 @@ bzl_library(
"proto_toolchain_rule.bzl",
],
visibility = ["//bazel:__subpackages__"],
+ deps = [
+ ":toolchain_helpers_bzl",
+ "//bazel/common:proto_common_bzl",
+ "//bazel/common:proto_lang_toolchain_info_bzl",
+ ],
)
bzl_library(
@@ -52,3 +62,26 @@ bzl_library(
"//bazel/common:proto_lang_toolchain_info_bzl",
],
)
+
+native_bool_flag(
+ name = "experimental_proto_descriptor_sets_include_source_info",
+ flag = "experimental_proto_descriptor_sets_include_source_info",
+ match_value = "true",
+ visibility = ["//visibility:public"],
+)
+
+native_bool_flag(
+ name = "strict_proto_deps",
+ flag = "strict_proto_deps",
+ match_value = "off",
+ result = False,
+ visibility = ["//visibility:public"],
+)
+
+native_bool_flag(
+ name = "strict_public_imports",
+ flag = "strict_public_imports",
+ match_value = "off",
+ result = False,
+ visibility = ["//visibility:public"],
+)
diff --git a/bazel/private/native_bool_flag.bzl b/bazel/private/native_bool_flag.bzl
new file mode 100644
index 0000000000..960fbed512
--- /dev/null
+++ b/bazel/private/native_bool_flag.bzl
@@ -0,0 +1,35 @@
+# Protocol Buffers - Google's data interchange format
+# Copyright 2008 Google Inc. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file or at
+# https://developers.google.com/open-source/licenses/bsd
+"""
+A helper rule that reads a native boolean flag.
+"""
+
+load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
+
+def _impl(ctx):
+ return [BuildSettingInfo(value = ctx.attr.value)]
+
+_native_bool_flag_rule = rule(
+ implementation = _impl,
+ attrs = {"value": attr.bool()},
+)
+
+def native_bool_flag(*, name, flag, match_value = "true", result = True, **kwargs):
+ _native_bool_flag_rule(
+ name = name,
+ value = select({
+ name + "_setting": result,
+ "//conditions:default": not result,
+ }),
+ **kwargs
+ )
+
+ native.config_setting(
+ name = name + "_setting",
+ values = {flag: match_value},
+ visibility = ["//visibility:private"],
+ )
diff --git a/bazel/private/proto_library_rule.bzl b/bazel/private/proto_library_rule.bzl
new file mode 100644
index 0000000000..b02f691f45
--- /dev/null
+++ b/bazel/private/proto_library_rule.bzl
@@ -0,0 +1,357 @@
+# Protocol Buffers - Google's data interchange format
+# Copyright 2008 Google Inc. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file or at
+# https://developers.google.com/open-source/licenses/bsd
+"""
+Implementation of proto_library rule.
+"""
+
+load("@bazel_skylib//lib:paths.bzl", "paths")
+load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
+load("@proto_bazel_features//:features.bzl", "bazel_features")
+load("//bazel/common:proto_common.bzl", "proto_common")
+load("//bazel/common:proto_info.bzl", "ProtoInfo")
+load("//bazel/private:toolchain_helpers.bzl", "toolchains")
+
+STRICT_DEPS_FLAG_TEMPLATE = (
+ #
+ "--direct_dependencies_violation_msg=" +
+ "%%s is imported, but %s doesn't directly depend on a proto_library that 'srcs' it."
+)
+
+def _check_srcs_package(target_package, srcs):
+ """Check that .proto files in sources are from the same package.
+
+ This is done to avoid clashes with the generated sources."""
+
+ #TODO: this does not work with filegroups that contain files that are not in the package
+ for src in srcs:
+ if target_package != src.label.package:
+ fail("Proto source with label '%s' must be in same package as consuming rule." % src.label)
+
+def _get_import_prefix(ctx):
+ """Gets and verifies import_prefix attribute if it is declared."""
+
+ import_prefix = ctx.attr.import_prefix
+
+ if not paths.is_normalized(import_prefix):
+ fail("should be normalized (without uplevel references or '.' path segments)", attr = "import_prefix")
+ if paths.is_absolute(import_prefix):
+ fail("should be a relative path", attr = "import_prefix")
+
+ return import_prefix
+
+def _get_strip_import_prefix(ctx):
+ """Gets and verifies strip_import_prefix."""
+
+ strip_import_prefix = ctx.attr.strip_import_prefix
+
+ if not paths.is_normalized(strip_import_prefix):
+ fail("should be normalized (without uplevel references or '.' path segments)", attr = "strip_import_prefix")
+
+ if paths.is_absolute(strip_import_prefix):
+ strip_import_prefix = strip_import_prefix[1:]
+ else: # Relative to current package
+ strip_import_prefix = _join(ctx.label.package, strip_import_prefix)
+
+ return strip_import_prefix.removesuffix("/")
+
+def _proto_library_impl(ctx):
+ # Verifies attributes.
+ _check_srcs_package(ctx.label.package, ctx.attr.srcs)
+ srcs = ctx.files.srcs
+ deps = [dep[ProtoInfo] for dep in ctx.attr.deps]
+ exports = [dep[ProtoInfo] for dep in ctx.attr.exports]
+ import_prefix = _get_import_prefix(ctx)
+ strip_import_prefix = _get_strip_import_prefix(ctx)
+ check_for_reexport = deps + exports if not srcs else exports
+ _PackageSpecificationInfo = bazel_features.globals.PackageSpecificationInfo
+ for proto in check_for_reexport:
+ if getattr(proto, "allow_exports", None):
+ if not _PackageSpecificationInfo:
+ fail("Allowlist checks not supported before Bazel 6.4.0")
+ if not proto.allow_exports[_PackageSpecificationInfo].contains(ctx.label):
+ fail("proto_library '%s' can't be reexported in package '//%s'" % (proto.direct_descriptor_set.owner, ctx.label.package))
+
+ proto_path, virtual_srcs = _process_srcs(ctx, srcs, import_prefix, strip_import_prefix)
+ descriptor_set = ctx.actions.declare_file(ctx.label.name + "-descriptor-set.proto.bin")
+ proto_info = ProtoInfo(
+ srcs = virtual_srcs,
+ deps = deps,
+ descriptor_set = descriptor_set,
+ proto_path = proto_path,
+ workspace_root = ctx.label.workspace_root,
+ bin_dir = ctx.bin_dir.path,
+ allow_exports = ctx.attr.allow_exports,
+ )
+
+ _write_descriptor_set(ctx, proto_info, deps, exports, descriptor_set)
+
+ # We assume that the proto sources will not have conflicting artifacts
+ # with the same root relative path
+ data_runfiles = ctx.runfiles(
+ files = [proto_info.direct_descriptor_set],
+ transitive_files = depset(transitive = [proto_info.transitive_sources]),
+ )
+ return [
+ proto_info,
+ DefaultInfo(
+ files = depset([proto_info.direct_descriptor_set]),
+ default_runfiles = ctx.runfiles(), # empty
+ data_runfiles = data_runfiles,
+ ),
+ ]
+
+def _process_srcs(ctx, srcs, import_prefix, strip_import_prefix):
+ """Returns proto_path and sources, optionally symlinking them to _virtual_imports.
+
+ Returns:
+ (str, [File]) A pair of proto_path and virtual_sources.
+ """
+ if import_prefix != "" or strip_import_prefix != "":
+ # Use virtual source roots
+ return _symlink_to_virtual_imports(ctx, srcs, import_prefix, strip_import_prefix)
+ else:
+ # No virtual source roots
+ return "", srcs
+
+def _join(*path):
+ return "/".join([p for p in path if p != ""])
+
+def _symlink_to_virtual_imports(ctx, srcs, import_prefix, strip_import_prefix):
+ """Symlinks srcs to _virtual_imports.
+
+ Returns:
+ A pair proto_path, directs_sources.
+ """
+ virtual_imports = _join("_virtual_imports", ctx.label.name)
+ proto_path = _join(ctx.label.package, virtual_imports)
+
+ if ctx.label.workspace_name == "":
+ full_strip_import_prefix = strip_import_prefix
+ else:
+ full_strip_import_prefix = _join("..", ctx.label.workspace_name, strip_import_prefix)
+ if full_strip_import_prefix:
+ full_strip_import_prefix += "/"
+
+ virtual_srcs = []
+ for src in srcs:
+ # Remove strip_import_prefix
+ if not src.short_path.startswith(full_strip_import_prefix):
+ fail(".proto file '%s' is not under the specified strip prefix '%s'" %
+ (src.short_path, full_strip_import_prefix))
+ import_path = src.short_path[len(full_strip_import_prefix):]
+
+ # Add import_prefix
+ virtual_src = ctx.actions.declare_file(_join(virtual_imports, import_prefix, import_path))
+ ctx.actions.symlink(
+ output = virtual_src,
+ target_file = src,
+ progress_message = "Symlinking virtual .proto sources for %{label}",
+ )
+ virtual_srcs.append(virtual_src)
+ return proto_path, virtual_srcs
+
+def _write_descriptor_set(ctx, proto_info, deps, exports, descriptor_set):
+ """Writes descriptor set."""
+ if proto_info.direct_sources == []:
+ ctx.actions.write(descriptor_set, "")
+ return
+
+ dependencies_descriptor_sets = depset(transitive = [dep.transitive_descriptor_sets for dep in deps])
+
+ args = ctx.actions.args()
+
+ if ctx.attr._experimental_proto_descriptor_sets_include_source_info[BuildSettingInfo].value:
+ args.add("--include_source_info")
+ if hasattr(ctx.attr, "_retain_options") and ctx.attr._retain_options:
+ args.add("--retain_options")
+
+ strict_deps = ctx.attr._strict_proto_deps[BuildSettingInfo].value
+ if strict_deps:
+ if proto_info.direct_sources:
+ strict_importable_sources = depset(
+ direct = proto_info._direct_proto_sources,
+ transitive = [dep._exported_sources for dep in deps],
+ )
+ else:
+ strict_importable_sources = None
+ if strict_importable_sources:
+ args.add_joined(
+ "--direct_dependencies",
+ strict_importable_sources,
+ map_each = proto_common.get_import_path,
+ join_with = ":",
+ )
+ # Example: `--direct_dependencies a.proto:b.proto`
+
+ else:
+ # The proto compiler requires an empty list to turn on strict deps checking
+ args.add("--direct_dependencies=")
+
+ # Set `-direct_dependencies_violation_msg=`
+ args.add(ctx.label, format = STRICT_DEPS_FLAG_TEMPLATE)
+
+ strict_imports = ctx.attr._strict_public_imports[BuildSettingInfo].value
+ if strict_imports:
+ public_import_protos = depset(transitive = [export._exported_sources for export in exports])
+ if not public_import_protos:
+ # This line is necessary to trigger the check.
+ args.add("--allowed_public_imports=")
+ else:
+ args.add_joined(
+ "--allowed_public_imports",
+ public_import_protos,
+ map_each = proto_common.get_import_path,
+ join_with = ":",
+ )
+ if proto_common.INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION:
+ toolchain = ctx.toolchains[toolchains.PROTO_TOOLCHAIN]
+ if not toolchain:
+ fail("Protocol compiler toolchain could not be resolved.")
+ proto_lang_toolchain_info = toolchain.proto
+ else:
+ proto_lang_toolchain_info = proto_common.ProtoLangToolchainInfo(
+ out_replacement_format_flag = "--descriptor_set_out=%s",
+ output_files = "single",
+ mnemonic = "GenProtoDescriptorSet",
+ progress_message = "Generating Descriptor Set proto_library %{label}",
+ proto_compiler = ctx.executable._proto_compiler,
+ protoc_opts = ctx.fragments.proto.experimental_protoc_opts,
+ plugin = None,
+ )
+
+ proto_common.compile(
+ ctx.actions,
+ proto_info,
+ proto_lang_toolchain_info,
+ generated_files = [descriptor_set],
+ additional_inputs = dependencies_descriptor_sets,
+ additional_args = args,
+ )
+
+proto_library = rule(
+ _proto_library_impl,
+ # TODO: proto_common docs are missing
+ # TODO: ProtoInfo link doesn't work and docs are missing
+ doc = """
+
If using Bazel, please load the rule from
+https://github.com/bazelbuild/rules_proto.
+
+
Use proto_library
to define libraries of protocol buffers which
+may be used from multiple languages. A proto_library
may be listed
+in the deps
clause of supported rules, such as
+java_proto_library
.
+
+
When compiled on the command-line, a proto_library
creates a file
+named foo-descriptor-set.proto.bin
, which is the descriptor set for
+the messages the rule srcs. The file is a serialized
+FileDescriptorSet
, which is described in
+
+https://developers.google.com/protocol-buffers/docs/techniques#self-description.
+
+
It only contains information about the .proto
files directly
+mentioned by a proto_library
rule; the collection of transitive
+descriptor sets is available through the
+[ProtoInfo].transitive_descriptor_sets
Starlark provider.
+See documentation in proto_info.bzl
.
+
+
Recommended code organization:
+
+- One
proto_library
rule per .proto
file.
+ - A file named
foo.proto
will be in a rule named foo_proto
,
+ which is located in the same package.
+ - A
[language]_proto_library
that wraps a proto_library
+ named foo_proto
should be called foo_[language]_proto
,
+ and be located in the same package.
+
""",
+ attrs = {
+ "srcs": attr.label_list(
+ allow_files = [".proto", ".protodevel"],
+ flags = ["DIRECT_COMPILE_TIME_INPUT"],
+ # TODO: Should .protodevel be advertised or deprecated?
+ doc = """
+The list of .proto
and .protodevel
files that are
+processed to create the target. This is usually a non empty list. One usecase
+where srcs
can be empty is an alias-library. This is a
+proto_library rule having one or more other proto_library in deps
.
+This pattern can be used to e.g. export a public api under a persistent name.""",
+ ),
+ "deps": attr.label_list(
+ providers = [ProtoInfo],
+ doc = """
+The list of other proto_library
rules that the target depends upon.
+A proto_library
may only depend on other proto_library
+targets. It may not depend on language-specific libraries.""",
+ ),
+ "exports": attr.label_list(
+ providers = [ProtoInfo],
+ doc = """
+List of proto_library targets that can be referenced via "import public" in the
+proto source.
+It's an error if you use "import public" but do not list the corresponding library
+in the exports attribute.
+Note that you have list the library both in deps and exports since not all
+lang_proto_library implementations have been changed yet.""",
+ ),
+ "strip_import_prefix": attr.string(
+ default = "/",
+ doc = """
+The prefix to strip from the paths of the .proto files in this rule.
+
+When set, .proto source files in the srcs
attribute of this rule are
+accessible at their path with this prefix cut off.
+
+
If it's a relative path (not starting with a slash), it's taken as a package-relative
+one. If it's an absolute one, it's understood as a repository-relative path.
+
+
The prefix in the import_prefix
attribute is added after this prefix is
+stripped.""",
+ ),
+ "import_prefix": attr.string(
+ doc = """
+The prefix to add to the paths of the .proto files in this rule.
+
+
When set, the .proto source files in the srcs
attribute of this rule are
+accessible at is the value of this attribute prepended to their repository-relative path.
+
+
The prefix in the strip_import_prefix
attribute is removed before this
+prefix is added.""",
+ ),
+ "allow_exports": attr.label(
+ cfg = "exec",
+ providers = [bazel_features.globals.PackageSpecificationInfo] if bazel_features.globals.PackageSpecificationInfo else [],
+ doc = """
+An optional allowlist that prevents proto library to be reexported or used in
+lang_proto_library that is not in one of the listed packages.""",
+ ),
+ "data": attr.label_list(
+ allow_files = True,
+ flags = ["SKIP_CONSTRAINTS_OVERRIDE"],
+ ),
+ # buildifier: disable=attr-license (calling attr.license())
+ "licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
+ "_experimental_proto_descriptor_sets_include_source_info": attr.label(
+ default = "//bazel/private:experimental_proto_descriptor_sets_include_source_info",
+ ),
+ "_strict_proto_deps": attr.label(
+ default =
+ "//bazel/private:strict_proto_deps",
+ ),
+ "_strict_public_imports": attr.label(
+ default = "//bazel/private:strict_public_imports",
+ ),
+ } | toolchains.if_legacy_toolchain({
+ "_proto_compiler": attr.label(
+ cfg = "exec",
+ executable = True,
+ allow_files = True,
+ default = configuration_field("proto", "proto_compiler"),
+ ),
+ }), # buildifier: disable=attr-licenses (attribute called licenses)
+ fragments = ["proto"],
+ provides = [ProtoInfo],
+ toolchains = toolchains.use_toolchain(toolchains.PROTO_TOOLCHAIN),
+)
diff --git a/bazel/private/proto_toolchain_rule.bzl b/bazel/private/proto_toolchain_rule.bzl
index 9487a06026..8a11fac9db 100644
--- a/bazel/private/proto_toolchain_rule.bzl
+++ b/bazel/private/proto_toolchain_rule.bzl
@@ -1,13 +1,9 @@
"""A Starlark implementation of the proto_toolchain rule."""
-load("//bazel/common:proto_common.bzl", "proto_common")
load("//bazel/common:proto_lang_toolchain_info.bzl", "ProtoLangToolchainInfo")
+load("//bazel/private:toolchain_helpers.bzl", "toolchains")
def _impl(ctx):
- kwargs = {}
- if getattr(proto_common, "INCOMPATIBLE_PASS_TOOLCHAIN_TYPE", False):
- kwargs["toolchain_type"] = "@rules_proto//proto:toolchain_type"
-
return [
DefaultInfo(
files = depset(),
@@ -23,7 +19,7 @@ def _impl(ctx):
protoc_opts = ctx.fragments.proto.experimental_protoc_opts,
progress_message = ctx.attr.progress_message,
mnemonic = ctx.attr.mnemonic,
- **kwargs
+ toolchain_type = toolchains.PROTO_TOOLCHAIN,
),
),
]
diff --git a/bazel/private/toolchain_helpers.bzl b/bazel/private/toolchain_helpers.bzl
index e58c9d6a0e..aa49eb8cf4 100644
--- a/bazel/private/toolchain_helpers.bzl
+++ b/bazel/private/toolchain_helpers.bzl
@@ -45,5 +45,5 @@ toolchains = struct(
find_toolchain = _find_toolchain,
if_legacy_toolchain = _if_legacy_toolchain,
INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION = _incompatible_toolchain_resolution,
- PROTO_TOOLCHAIN = "@rules_proto//proto:toolchain_type",
+ PROTO_TOOLCHAIN = "//bazel/private:proto_toolchain_type",
)
diff --git a/bazel/proto_library.bzl b/bazel/proto_library.bzl
index 3006e3c0c2..f0fece1553 100644
--- a/bazel/proto_library.bzl
+++ b/bazel/proto_library.bzl
@@ -1,3 +1,20 @@
-"""proto_library rule"""
+# Protocol Buffers - Google's data interchange format
+# Copyright 2008 Google Inc. All rights reserved.
+#
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file or at
+# https://developers.google.com/open-source/licenses/bsd
+"""
+Macro of proto_library rule.
+"""
-proto_library = native.proto_library
+load("@proto_bazel_features//:features.bzl", "bazel_features")
+load("//bazel/private:proto_library_rule.bzl", _proto_library = "proto_library")
+
+def proto_library(**kwattrs):
+ # This condition causes Starlark rules to be used only on Bazel >=7.0.0
+ if bazel_features.proto.starlark_proto_info:
+ _proto_library(**kwattrs)
+ else:
+ # On older Bazel versions keep using native rules, so that mismatch in ProtoInfo doesn't happen
+ native.proto_library(**kwattrs)
diff --git a/bazel/py_proto_library.bzl b/bazel/py_proto_library.bzl
index 86af999502..6e3d041f36 100644
--- a/bazel/py_proto_library.bzl
+++ b/bazel/py_proto_library.bzl
@@ -3,6 +3,7 @@
load("@rules_python//python:py_info.bzl", "PyInfo")
load("//bazel/common:proto_common.bzl", "proto_common")
load("//bazel/common:proto_info.bzl", "ProtoInfo")
+load("//bazel/private:toolchain_helpers.bzl", "toolchains")
PY_PROTO_TOOLCHAIN = "@rules_python//python/proto:toolchain_type"
@@ -22,9 +23,6 @@ _PyProtoInfo = provider(
def _filter_provider(provider, *attrs):
return [dep[provider] for attr in attrs for dep in attr if provider in dep]
-def _incompatible_toolchains_enabled():
- return getattr(proto_common, "INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION", False)
-
def _py_proto_aspect_impl(target, ctx):
"""Generates and compiles Python code for a proto_library.
@@ -51,7 +49,7 @@ def _py_proto_aspect_impl(target, ctx):
proto.path,
))
- if _incompatible_toolchains_enabled():
+ if proto_common.INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION:
toolchain = ctx.toolchains[PY_PROTO_TOOLCHAIN]
if not toolchain:
fail("No toolchains registered for '%s'." % PY_PROTO_TOOLCHAIN)
@@ -120,15 +118,15 @@ def _py_proto_aspect_impl(target, ctx):
_py_proto_aspect = aspect(
implementation = _py_proto_aspect_impl,
- attrs = {} if _incompatible_toolchains_enabled() else {
+ attrs = toolchains.if_legacy_toolchain({
"_aspect_proto_toolchain": attr.label(
default = "//python:python_toolchain",
),
- },
+ }),
attr_aspects = ["deps"],
required_providers = [ProtoInfo],
provides = [_PyProtoInfo],
- toolchains = [PY_PROTO_TOOLCHAIN] if _incompatible_toolchains_enabled() else [],
+ toolchains = toolchains.use_toolchain(PY_PROTO_TOOLCHAIN),
)
def _py_proto_library_rule(ctx):
diff --git a/bazel/toolchains/BUILD.bazel b/bazel/toolchains/BUILD.bazel
index 34a45d5bbd..2c21426b15 100644
--- a/bazel/toolchains/BUILD.bazel
+++ b/bazel/toolchains/BUILD.bazel
@@ -8,6 +8,7 @@ bzl_library(
visibility = ["//visibility:public"],
deps = [
"//bazel/private:proto_toolchain_rule_bzl",
+ "//bazel/private:toolchain_helpers_bzl",
],
)
diff --git a/bazel/toolchains/proto_toolchain.bzl b/bazel/toolchains/proto_toolchain.bzl
index 171e08cad5..1bad37b3a6 100644
--- a/bazel/toolchains/proto_toolchain.bzl
+++ b/bazel/toolchains/proto_toolchain.bzl
@@ -4,6 +4,7 @@ The macro additionally creates toolchain target when toolchain_type is given.
"""
load("//bazel/private:proto_toolchain_rule.bzl", _proto_toolchain_rule = "proto_toolchain")
+load("//bazel/private:toolchain_helpers.bzl", "toolchains")
def proto_toolchain(*, name, proto_compiler, exec_compatible_with = []):
"""Creates a proto_toolchain and toolchain target for proto_library.
@@ -19,7 +20,7 @@ def proto_toolchain(*, name, proto_compiler, exec_compatible_with = []):
native.toolchain(
name = name + "_toolchain",
- toolchain_type = "@rules_proto//proto:toolchain_type",
+ toolchain_type = toolchains.PROTO_TOOLCHAIN,
exec_compatible_with = exec_compatible_with,
target_compatible_with = [],
toolchain = name,
diff --git a/build_defs/cpp_opts.bzl b/build_defs/cpp_opts.bzl
index f667a40881..46b60252f6 100644
--- a/build_defs/cpp_opts.bzl
+++ b/build_defs/cpp_opts.bzl
@@ -15,7 +15,6 @@ COPTS = select({
"/wd4506", # no definition for inline function 'function'
"/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning)
"/wd4996", # The compiler encountered a deprecated declaration.
- "/utf-8", # Set source and execution character sets to UTF-8
],
"//conditions:default": [
"-DHAVE_ZLIB",
diff --git a/conformance/BUILD.bazel b/conformance/BUILD.bazel
index 384bb56563..e38330df62 100644
--- a/conformance/BUILD.bazel
+++ b/conformance/BUILD.bazel
@@ -143,6 +143,7 @@ cc_library(
":conformance_cc_proto",
"//src/google/protobuf",
"//src/google/protobuf:descriptor_legacy",
+ "//src/google/protobuf:endian",
"//src/google/protobuf:protobuf_lite",
"//src/google/protobuf/util:differencer",
"//src/google/protobuf/util:json_util",
@@ -232,6 +233,7 @@ cc_binary(
"//src/google/protobuf",
"//src/google/protobuf:port",
"//src/google/protobuf:protobuf_lite",
+ "//src/google/protobuf/json",
"//src/google/protobuf/stubs",
"//src/google/protobuf/util:json_util",
"//src/google/protobuf/util:type_resolver",
@@ -304,6 +306,11 @@ py_binary(
],
)
+py_binary(
+ name = "update_failure_list",
+ srcs = ["update_failure_list.py"],
+)
+
inline_sh_binary(
name = "conformance_php",
testonly = 1,
diff --git a/conformance/binary_json_conformance_suite.cc b/conformance/binary_json_conformance_suite.cc
index f631b9adad..892a2a4426 100644
--- a/conformance/binary_json_conformance_suite.cc
+++ b/conformance/binary_json_conformance_suite.cc
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
@@ -25,6 +26,8 @@
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/strings/substitute.h"
+#include "json/reader.h"
+#include "json/value.h"
#include "conformance/conformance.pb.h"
#include "conformance_test.h"
#include "conformance/test_protos/test_messages_edition2023.pb.h"
@@ -43,6 +46,7 @@
using conformance::ConformanceRequest;
using conformance::ConformanceResponse;
+using conformance::TestStatus;
using conformance::WireFormat;
using google::protobuf::Descriptor;
using google::protobuf::FieldDescriptor;
@@ -302,19 +306,22 @@ bool BinaryAndJsonConformanceSuite::ParseResponse(
const std::string& test_name = setting.GetTestName();
ConformanceLevel level = setting.GetLevel();
+ TestStatus test;
+ test.set_name(test_name);
switch (response.result_case()) {
case ConformanceResponse::kProtobufPayload: {
if (requested_output != conformance::PROTOBUF) {
- ReportFailure(test_name, level, request, response,
- absl::StrCat("Test was asked for ",
- WireFormatToString(requested_output),
- " output but provided PROTOBUF instead."));
+ test.set_failure_message(absl::StrCat(
+ "Test was asked for ", WireFormatToString(requested_output),
+ " output but provided PROTOBUF instead."));
+ ReportFailure(test, level, request, response);
return false;
}
if (!test_message->ParseFromString(response.protobuf_payload())) {
- ReportFailure(test_name, level, request, response,
- "Protobuf output we received from test was unparseable.");
+ test.set_failure_message(
+ "Protobuf output we received from test was unparseable.");
+ ReportFailure(test, level, request, response);
return false;
}
@@ -323,16 +330,17 @@ bool BinaryAndJsonConformanceSuite::ParseResponse(
case ConformanceResponse::kJsonPayload: {
if (requested_output != conformance::JSON) {
- ReportFailure(test_name, level, request, response,
- absl::StrCat("Test was asked for ",
- WireFormatToString(requested_output),
- " output but provided JSON instead."));
+ test.set_failure_message(absl::StrCat(
+ "Test was asked for ", WireFormatToString(requested_output),
+ " output but provided JSON instead."));
+ ReportFailure(test, level, request, response);
return false;
}
if (!ParseJsonResponse(response, test_message)) {
- ReportFailure(test_name, level, request, response,
- "JSON output we received from test was unparseable.");
+ test.set_failure_message(
+ "JSON output we received from test was unparseable.");
+ ReportFailure(test, level, request, response);
return false;
}
@@ -437,14 +445,19 @@ void BinaryAndJsonConformanceSuiteImpl::
absl::StrCat(setting.ConformanceLevelToString(level), ".",
setting.GetSyntaxIdentifier(), ".ProtobufInput.", test_name);
- suite_.RunTest(effective_test_name, request, &response);
+ if (!suite_.RunTest(effective_test_name, request, &response)) {
+ return;
+ }
+
+ TestStatus test;
+ test.set_name(effective_test_name);
if (response.result_case() == ConformanceResponse::kParseError) {
- suite_.ReportSuccess(effective_test_name);
+ suite_.ReportSuccess(test);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(effective_test_name, request, response);
+ suite_.ReportSkip(test, request, response);
} else {
- suite_.ReportFailure(effective_test_name, level, request, response,
- "Should have failed to parse, but didn't.");
+ test.set_failure_message("Should have failed to parse, but didn't.");
+ suite_.ReportFailure(test, level, request, response);
}
}
@@ -631,34 +644,38 @@ void BinaryAndJsonConformanceSuiteImpl<
setting.ConformanceLevelToString(level), ".",
setting.GetSyntaxIdentifier(), ".JsonInput.", test_name, ".Validator");
- suite_.RunTest(effective_test_name, request, &response);
+ if (!suite_.RunTest(effective_test_name, request, &response)) {
+ return;
+ }
+ TestStatus test;
+ test.set_name(effective_test_name);
if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(effective_test_name, request, response);
+ suite_.ReportSkip(test, request, response);
return;
}
if (response.result_case() != ConformanceResponse::kJsonPayload) {
- suite_.ReportFailure(effective_test_name, level, request, response,
- absl::StrCat("Expected JSON payload but got type ",
- response.result_case()));
+ test.set_failure_message(absl::StrCat("Expected JSON payload but got type ",
+ response.result_case()));
+ suite_.ReportFailure(test, level, request, response);
return;
}
Json::Reader reader;
Json::Value value;
if (!reader.parse(response.json_payload(), value)) {
- suite_.ReportFailure(
- effective_test_name, level, request, response,
+ test.set_failure_message(
absl::StrCat("JSON payload cannot be parsed as valid JSON: ",
reader.getFormattedErrorMessages()));
+ suite_.ReportFailure(test, level, request, response);
return;
}
if (!validator(value)) {
- suite_.ReportFailure(effective_test_name, level, request, response,
- "JSON payload validation failed.");
+ test.set_failure_message("JSON payload validation failed.");
+ suite_.ReportFailure(test, level, request, response);
return;
}
- suite_.ReportSuccess(effective_test_name);
+ suite_.ReportSuccess(test);
}
template
@@ -677,14 +694,19 @@ void BinaryAndJsonConformanceSuiteImpl::ExpectParseFailureForJson(
absl::StrCat(setting.ConformanceLevelToString(level), ".",
SyntaxIdentifier(), ".JsonInput.", test_name);
- suite_.RunTest(effective_test_name, request, &response);
+ if (!suite_.RunTest(effective_test_name, request, &response)) {
+ return;
+ }
+
+ TestStatus test;
+ test.set_name(effective_test_name);
if (response.result_case() == ConformanceResponse::kParseError) {
- suite_.ReportSuccess(effective_test_name);
+ suite_.ReportSuccess(test);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(effective_test_name, request, response);
+ suite_.ReportSkip(test, request, response);
} else {
- suite_.ReportFailure(effective_test_name, level, request, response,
- "Should have failed to parse, but didn't.");
+ test.set_failure_message("Should have failed to parse, but didn't.");
+ suite_.ReportFailure(test, level, request, response);
}
}
@@ -707,14 +729,19 @@ void BinaryAndJsonConformanceSuiteImpl::
absl::StrCat(setting.ConformanceLevelToString(level), ".",
SyntaxIdentifier(), ".", test_name, ".JsonOutput");
- suite_.RunTest(effective_test_name, request, &response);
+ if (!suite_.RunTest(effective_test_name, request, &response)) {
+ return;
+ }
+
+ TestStatus test;
+ test.set_name(effective_test_name);
if (response.result_case() == ConformanceResponse::kSerializeError) {
- suite_.ReportSuccess(effective_test_name);
+ suite_.ReportSuccess(test);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(effective_test_name, request, response);
+ suite_.ReportSkip(test, request, response);
} else {
- suite_.ReportFailure(effective_test_name, level, request, response,
- "Should have failed to serialize, but didn't.");
+ test.set_failure_message("Should have failed to serialize, but didn't.");
+ suite_.ReportFailure(test, level, request, response);
}
}
@@ -1207,7 +1234,7 @@ void BinaryAndJsonConformanceSuiteImpl::TestValidDataForOneofType(
{
// Tests oneof with default value.
- const std::string proto = default_value;
+ const std::string& proto = default_value;
MessageType test_message;
test_message.MergeFromString(proto);
std::string text;
@@ -1223,7 +1250,7 @@ void BinaryAndJsonConformanceSuiteImpl::TestValidDataForOneofType(
{
// Tests oneof with non-default value.
- const std::string proto = non_default_value;
+ const std::string& proto = non_default_value;
MessageType test_message;
test_message.MergeFromString(proto);
std::string text;
@@ -1240,7 +1267,7 @@ void BinaryAndJsonConformanceSuiteImpl::TestValidDataForOneofType(
{
// Tests oneof with multiple values of the same field.
const std::string proto = absl::StrCat(default_value, non_default_value);
- const std::string expected_proto = non_default_value;
+ const std::string& expected_proto = non_default_value;
MessageType test_message;
test_message.MergeFromString(expected_proto);
std::string text;
@@ -1266,7 +1293,7 @@ void BinaryAndJsonConformanceSuiteImpl::TestValidDataForOneofType(
GetDefaultValue(other_type));
const std::string proto = absl::StrCat(other_value, non_default_value);
- const std::string expected_proto = non_default_value;
+ const std::string& expected_proto = non_default_value;
MessageType test_message;
test_message.MergeFromString(expected_proto);
std::string text;
@@ -1420,12 +1447,18 @@ void BinaryAndJsonConformanceSuiteImpl::TestUnknownOrdering() {
conformance::BINARY_TEST, prototype, "UnknownOrdering", serialized);
const ConformanceRequest& request = setting.GetRequest();
ConformanceResponse response;
- suite_.RunTest(setting.GetTestName(), request, &response);
+ if (!suite_.RunTest(setting.GetTestName(), request, &response)) {
+ return;
+ }
+
MessageType response_message;
+ TestStatus test;
+ test.set_name(setting.GetTestName());
if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(setting.GetTestName(), request, response);
+ suite_.ReportSkip(test, request, response);
return;
}
+
suite_.ParseResponse(response, setting, &response_message);
const UnknownFieldSet& ufs = response_message.unknown_fields();
@@ -1441,10 +1474,10 @@ void BinaryAndJsonConformanceSuiteImpl::TestUnknownOrdering() {
ufs.field(1).varint() != 123 ||
ufs.field(2).length_delimited() != "def" ||
ufs.field(3).varint() != 456) {
- suite_.ReportFailure(setting.GetTestName(), setting.GetLevel(), request,
- response, "Unknown field mismatch");
+ test.set_failure_message("Unknown field mismatch");
+ suite_.ReportFailure(test, setting.GetLevel(), request, response);
} else {
- suite_.ReportSuccess(setting.GetTestName());
+ suite_.ReportSuccess(test);
}
}
diff --git a/conformance/conformance.proto b/conformance/conformance.proto
index 2357d59ad6..a53b5e21d4 100644
--- a/conformance/conformance.proto
+++ b/conformance/conformance.proto
@@ -57,11 +57,20 @@ enum TestCategory {
TEXT_FORMAT_TEST = 5;
}
+// Meant to encapsulate all types of tests: successes, skips, failures, etc.
+// Therefore, this may or may not have a failure message. Failure messages
+// may be truncated for our failure lists.
+message TestStatus {
+ string name = 1;
+ string failure_message = 2;
+}
+
// The conformance runner will request a list of failures as the first request.
// This will be known by message_type == "conformance.FailureSet", a conformance
// test should return a serialized FailureSet in protobuf_payload.
message FailureSet {
- repeated string failure = 1;
+ repeated TestStatus test = 2;
+ reserved 1;
}
// Represents a single test case's input. The testee should:
diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc
index 0f4196a480..45fa91aa7f 100644
--- a/conformance/conformance_cpp.cc
+++ b/conformance/conformance_cpp.cc
@@ -7,15 +7,15 @@
#include
#include
+#include
#include
#include
#include
+#include
#include
#include
-#include "google/protobuf/util/json_util.h"
-#include "google/protobuf/util/type_resolver_util.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
@@ -27,12 +27,15 @@
#include "editions/golden/test_messages_proto2_editions.pb.h"
#include "editions/golden/test_messages_proto3_editions.pb.h"
#include "google/protobuf/endian.h"
+#include "google/protobuf/json/json.h"
#include "google/protobuf/message.h"
#include "google/protobuf/test_messages_proto2.pb.h"
#include "google/protobuf/test_messages_proto3.pb.h"
#include "google/protobuf/test_messages_proto3.pb.h"
#include "google/protobuf/text_format.h"
+#include "google/protobuf/util/json_util.h"
#include "google/protobuf/util/type_resolver.h"
+#include "google/protobuf/util/type_resolver_util.h"
#include "google/protobuf/stubs/status_macros.h"
// Must be included last.
@@ -241,8 +244,9 @@ absl::StatusOr Harness::ServeConformanceRequest() {
serialized_output.size()));
if (verbose_) {
- ABSL_LOG(INFO) << "conformance-cpp: request=" << request.ShortDebugString()
- << ", response=" << response->ShortDebugString();
+ ABSL_LOG(INFO) << "conformance-cpp: request="
+ << google::protobuf::ShortFormat(request)
+ << ", response=" << google::protobuf::ShortFormat(*response);
}
return false;
}
diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py
index 60182e1e9f..77076bd885 100755
--- a/conformance/conformance_python.py
+++ b/conformance/conformance_python.py
@@ -98,36 +98,38 @@ def do_test(request):
"Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT64",
]
for x in failures:
- failure_set.failure.append(x)
+ failure_set.test.append(conformance_pb2.TestStatus(name=x))
response.protobuf_payload = failure_set.SerializeToString()
return response
- isJson = (request.WhichOneof('payload') == 'json_payload')
+ isJson = request.WhichOneof("payload") == "json_payload"
test_message = _create_test_message(request.message_type)
if (not isJson) and (test_message is None):
raise ProtocolError("Protobuf request doesn't have specific payload type")
try:
- if request.WhichOneof('payload') == 'protobuf_payload':
+ if request.WhichOneof("payload") == "protobuf_payload":
try:
test_message.ParseFromString(request.protobuf_payload)
except message.DecodeError as e:
response.parse_error = str(e)
return response
- elif request.WhichOneof('payload') == 'json_payload':
+ elif request.WhichOneof("payload") == "json_payload":
try:
- ignore_unknown_fields = \
- request.test_category == \
- conformance_pb2.JSON_IGNORE_UNKNOWN_PARSING_TEST
- json_format.Parse(request.json_payload, test_message,
- ignore_unknown_fields)
+ ignore_unknown_fields = (
+ request.test_category
+ == conformance_pb2.JSON_IGNORE_UNKNOWN_PARSING_TEST
+ )
+ json_format.Parse(
+ request.json_payload, test_message, ignore_unknown_fields
+ )
except Exception as e:
response.parse_error = str(e)
return response
- elif request.WhichOneof('payload') == 'text_payload':
+ elif request.WhichOneof("payload") == "text_payload":
try:
text_format.Parse(request.text_payload, test_message)
except Exception as e:
@@ -152,7 +154,8 @@ def do_test(request):
elif request.requested_output_format == conformance_pb2.TEXT_FORMAT:
response.text_payload = text_format.MessageToString(
- test_message, print_unknown_fields=request.print_unknown_fields)
+ test_message, print_unknown_fields=request.print_unknown_fields
+ )
except Exception as e:
response.runtime_error = str(e)
@@ -163,7 +166,7 @@ def do_test(request):
def do_test_io():
length_bytes = sys.stdin.buffer.read(4)
if len(length_bytes) == 0:
- return False # EOF
+ return False # EOF
elif len(length_bytes) != 4:
raise IOError("I/O error")
@@ -183,17 +186,24 @@ def do_test_io():
sys.stdout.buffer.flush()
if verbose:
- sys.stderr.write("conformance_python: request=%s, response=%s\n" % (
- request.ShortDebugString().c_str(),
- response.ShortDebugString().c_str()))
+ sys.stderr.write(
+ "conformance_python: request=%s, response=%s\n"
+ % (
+ request.ShortDebugString().c_str(),
+ response.ShortDebugString().c_str(),
+ )
+ )
global test_count
test_count += 1
return True
+
while True:
if not do_test_io():
- sys.stderr.write("conformance_python: received EOF from test runner " +
- "after %s tests, exiting\n" % (test_count))
+ sys.stderr.write(
+ "conformance_python: received EOF from test runner "
+ + "after %s tests, exiting\n" % (test_count,)
+ )
sys.exit(0)
diff --git a/conformance/conformance_rust.rs b/conformance/conformance_rust.rs
index adfe8578ab..1d428dfb32 100644
--- a/conformance/conformance_rust.rs
+++ b/conformance/conformance_rust.rs
@@ -7,12 +7,14 @@
use conformance_rust_proto::{ConformanceRequest, ConformanceResponse, WireFormat};
#[cfg(cpp_kernel)]
-use protobuf_cpp as kernel;
+use protobuf_cpp as protobuf;
#[cfg(upb_kernel)]
-use protobuf_upb as kernel;
+use protobuf_upb as protobuf;
-use kernel::Optional::{Set, Unset};
+use protobuf::prelude::*;
+use protobuf::Optional::{Set, Unset};
+use protobuf::ParseError;
use std::io::{self, ErrorKind, Read, Write};
use test_messages_edition2023_rust_proto::TestAllTypesEdition2023;
@@ -73,52 +75,39 @@ fn do_test(req: &ConformanceRequest) -> ConformanceResponse {
Set(bytes) => bytes,
};
+ fn roundtrip(bytes: &[u8]) -> Result, ParseError> {
+ T::parse(bytes).map(|msg| msg.serialize().unwrap())
+ }
+
let serialized = match message_type.as_bytes() {
b"protobuf_test_messages.proto2.TestAllTypesProto2" => {
- if let Ok(msg) = TestAllTypesProto2::parse(bytes) {
- msg.serialize().unwrap()
- } else {
- resp.set_parse_error("failed to parse bytes");
- return resp;
- }
+ roundtrip::(bytes)
}
b"protobuf_test_messages.proto3.TestAllTypesProto3" => {
- if let Ok(msg) = TestAllTypesProto3::parse(bytes) {
- msg.serialize().unwrap()
- } else {
- resp.set_parse_error("failed to parse bytes");
- return resp;
- }
+ roundtrip::(bytes)
}
b"protobuf_test_messages.editions.TestAllTypesEdition2023" => {
- if let Ok(msg) = TestAllTypesEdition2023::parse(bytes) {
- msg.serialize().unwrap()
- } else {
- resp.set_parse_error("failed to parse bytes");
- return resp;
- }
+ roundtrip::(bytes)
}
b"protobuf_test_messages.editions.proto2.TestAllTypesProto2" => {
- if let Ok(msg) = EditionsTestAllTypesProto2::parse(bytes) {
- msg.serialize().unwrap()
- } else {
- resp.set_parse_error("failed to parse bytes");
- return resp;
- }
+ roundtrip::(bytes)
}
b"protobuf_test_messages.editions.proto3.TestAllTypesProto3" => {
- if let Ok(msg) = EditionsTestAllTypesProto3::parse(bytes) {
- msg.serialize().unwrap()
- } else {
- resp.set_parse_error("failed to parse bytes");
- return resp;
- }
+ roundtrip::(bytes)
}
_ => panic!("unexpected msg type {message_type}"),
};
- resp.set_protobuf_payload(serialized);
- return resp;
+ match serialized {
+ Ok(serialized) => {
+ resp.set_protobuf_payload(serialized);
+ }
+ Err(_) => {
+ resp.set_parse_error("failed to parse bytes");
+ }
+ }
+
+ resp
}
fn main() {
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc
index 2d7dfcd344..2b0d728ae0 100644
--- a/conformance/conformance_test.cc
+++ b/conformance/conformance_test.cc
@@ -9,14 +9,19 @@
#include
+#include
#include
#include
+#include
#include
#include
#include
+#include
#include "google/protobuf/util/field_comparator.h"
#include "google/protobuf/util/message_differencer.h"
+#include "absl/container/btree_map.h"
+#include "absl/container/flat_hash_set.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_cat.h"
@@ -25,11 +30,13 @@
#include "conformance/conformance.pb.h"
#include "conformance/conformance.pb.h"
#include "google/protobuf/descriptor_legacy.h"
+#include "google/protobuf/endian.h"
#include "google/protobuf/message.h"
#include "google/protobuf/text_format.h"
using conformance::ConformanceRequest;
using conformance::ConformanceResponse;
+using conformance::TestStatus;
using conformance::WireFormat;
using google::protobuf::util::DefaultFieldComparator;
using google::protobuf::util::MessageDifferencer;
@@ -37,6 +44,15 @@ using std::string;
namespace {
+static void ReplaceAll(std::string& input, std::string replace_word,
+ std::string replace_by) {
+ size_t pos = input.find(replace_word);
+ while (pos != std::string::npos) {
+ input.replace(pos, replace_word.length(), replace_by);
+ pos = input.find(replace_word, pos + replace_by.length());
+ }
+}
+
static std::string ToOctString(const std::string& binary_string) {
std::string oct_string;
for (size_t i = 0; i < binary_string.size(); i++) {
@@ -52,16 +68,83 @@ static std::string ToOctString(const std::string& binary_string) {
return oct_string;
}
-template
-bool CheckSetEmpty(const SetT& set_to_check, absl::string_view write_to_file,
- absl::string_view msg, absl::string_view output_dir,
- std::string* output) {
+// Returns full filename path of written .txt file if successful
+static std::string ProduceOctalSerialized(const std::string& request,
+ uint32_t len) {
+ char* len_split_bytes = static_cast(static_cast(&len));
+
+ std::string out;
+
+ std::string hex_repr;
+ for (int i = 0; i < 4; i++) {
+ auto conversion = (unsigned int)static_cast(len_split_bytes[i]);
+ std::string hex = absl::StrFormat("\\x%x", conversion);
+ absl::StrAppend(&hex_repr, hex);
+ }
+
+ absl::StrAppend(&out, hex_repr);
+
+ absl::StrAppend(&out, ToOctString(request));
+
+ return out;
+}
+
+static std::string WriteToFile(const std::string& octal_serialized,
+ const std::string& output_dir,
+ const std::string& test_name) {
+ std::string test_name_txt = test_name;
+ ReplaceAll(test_name_txt, ".", "_");
+ absl::StrAppend(&test_name_txt, ".txt");
+ std::string full_filename;
+ if (!output_dir.empty()) {
+ full_filename = output_dir;
+ if (*output_dir.rbegin() != '/') {
+ full_filename.push_back('/');
+ }
+ absl::StrAppend(&full_filename, test_name_txt);
+ }
+ std::ofstream os{std::string(full_filename)};
+ if (os) {
+ os << octal_serialized;
+ return full_filename;
+ } else {
+ ABSL_LOG(INFO) << "Failed to open file for debugging: " << full_filename
+ << "\n";
+ return "";
+ }
+}
+
+// Removes all newlines.
+static void Normalize(std::string& input) {
+ input.erase(std::remove(input.begin(), input.end(), '\n'), input.end());
+}
+
+// Sets up a failure message properly for our failure lists.
+static TestStatus FormatFailureMessage(TestStatus& input) {
+ // Make copy just this once, as we need to modify it for our failure lists.
+ std::string formatted_failure_message = input.failure_message();
+ // Remove newlines
+ Normalize(formatted_failure_message);
+ // Truncate failure message if needed
+ if (formatted_failure_message.length() > 128) {
+ formatted_failure_message = formatted_failure_message.substr(0, 128);
+ }
+ TestStatus properly_formatted;
+ properly_formatted.set_name(input.name());
+ properly_formatted.set_failure_message(formatted_failure_message);
+ return properly_formatted;
+}
+
+bool CheckSetEmpty(const absl::btree_map& set_to_check,
+ absl::string_view write_to_file, absl::string_view msg,
+ absl::string_view output_dir, std::string* output) {
if (set_to_check.empty()) return true;
absl::StrAppendFormat(output, "\n");
absl::StrAppendFormat(output, "%s\n\n", msg);
- for (absl::string_view v : set_to_check) {
- absl::StrAppendFormat(output, " %s\n", v);
+ for (const auto& pair : set_to_check) {
+ absl::StrAppendFormat(output, " %s # %s\n", pair.first,
+ pair.second.failure_message());
}
absl::StrAppendFormat(output, "\n");
@@ -70,19 +153,18 @@ bool CheckSetEmpty(const SetT& set_to_check, absl::string_view write_to_file,
absl::string_view filename = write_to_file;
if (!output_dir.empty()) {
full_filename = std::string(output_dir);
- if (*output_dir.rbegin() != '/') {
- full_filename.push_back('/');
- }
absl::StrAppend(&full_filename, write_to_file);
filename = full_filename;
}
std::ofstream os{std::string(filename)};
if (os) {
- for (absl::string_view v : set_to_check) {
- os << v << "\n";
+ for (const auto& pair : set_to_check) {
+ os << pair.first << " # " << pair.second.failure_message() << "\n";
}
} else {
- absl::StrAppendFormat(output, "Failed to open file: %s\n", filename);
+ absl::StrAppendFormat(output,
+ "Failed to open file: %s\n",
+ filename);
}
}
@@ -265,47 +347,72 @@ ConformanceResponse ConformanceTestSuite::TruncateResponse(
return debug_response;
}
-void ConformanceTestSuite::ReportSuccess(const std::string& test_name) {
- if (expected_to_fail_.erase(test_name) != 0) {
+void ConformanceTestSuite::ReportSuccess(const TestStatus& test) {
+ if (expected_to_fail_.erase(test.name()) != 0) {
absl::StrAppendFormat(
&output_,
"ERROR: test %s is in the failure list, but test succeeded. "
"Remove it from the failure list.\n",
- test_name);
- unexpected_succeeding_tests_.insert(test_name);
+ test.name());
+ unexpected_succeeding_tests_[test.name()] = test;
}
successes_++;
}
-void ConformanceTestSuite::ReportFailure(const std::string& test_name,
+void ConformanceTestSuite::ReportFailure(TestStatus& test,
ConformanceLevel level,
const ConformanceRequest& request,
- const ConformanceResponse& response,
- absl::string_view message) {
- if (expected_to_fail_.erase(test_name) == 1) {
- expected_failures_++;
+ const ConformanceResponse& response) {
+ if (expected_to_fail_.contains(test.name())) {
+ // Make copy just this once, as we need to modify them for comparison.
+ // Failure message from the failure list.
+ string expected_failure_message =
+ expected_to_fail_[test.name()].failure_message();
+ // Actual failure message from the test run.
+ std::string actual_failure_message = test.failure_message();
+
+ Normalize(actual_failure_message);
+ if (actual_failure_message.rfind(expected_failure_message, 0) == 0) {
+ // Our failure messages match.
+ expected_failures_++;
+ } else {
+ // We want to add the test to the failure list with its correct failure
+ // message.
+ unexpected_failure_messages_[test.name()] = FormatFailureMessage(test);
+ // We want to remove the test from the failure list. That means passing
+ // to it the same failure message that was in the list.
+ TestStatus incorrect_failure_message;
+ incorrect_failure_message.set_name(test.name());
+ incorrect_failure_message.set_failure_message(
+ expected_to_fail_[test.name()].failure_message());
+
+ expected_failure_messages_[test.name()] = incorrect_failure_message;
+ }
+ expected_to_fail_.erase(test.name());
if (!verbose_) return;
} else if (level == RECOMMENDED && !enforce_recommended_) {
- absl::StrAppendFormat(&output_, "WARNING, test=%s: ", test_name);
+ absl::StrAppendFormat(&output_, "WARNING, test=%s: ", test.name());
} else {
- absl::StrAppendFormat(&output_, "ERROR, test=%s: ", test_name);
- unexpected_failing_tests_.insert(test_name);
+ absl::StrAppendFormat(&output_, "ERROR, test=%s: ", test.name());
+
+ unexpected_failing_tests_[test.name()] = FormatFailureMessage(test);
}
- absl::StrAppendFormat(&output_, "%s, request=%s, response=%s\n", message,
+ absl::StrAppendFormat(&output_, "%s, request=%s, response=%s\n",
+ test.failure_message(),
TruncateRequest(request).ShortDebugString(),
TruncateResponse(response).ShortDebugString());
}
-void ConformanceTestSuite::ReportSkip(const std::string& test_name,
+void ConformanceTestSuite::ReportSkip(const TestStatus& test,
const ConformanceRequest& request,
const ConformanceResponse& response) {
if (verbose_) {
absl::StrAppendFormat(
- &output_, "SKIPPED, test=%s request=%s, response=%s\n", test_name,
+ &output_, "SKIPPED, test=%s request=%s, response=%s\n", test.name(),
request.ShortDebugString(), response.ShortDebugString());
}
- skipped_.insert(test_name);
+ skipped_[test.name()] = test;
}
void ConformanceTestSuite::RunValidInputTest(
@@ -326,7 +433,10 @@ void ConformanceTestSuite::RunValidBinaryInputTest(
const std::string& equivalent_wire_format, bool require_same_wire_format) {
const ConformanceRequest& request = setting.GetRequest();
ConformanceResponse response;
- RunTest(setting.GetTestName(), request, &response);
+ if (!RunTest(setting.GetTestName(), request, &response)) {
+ return;
+ }
+
VerifyResponse(setting, equivalent_wire_format, response, true,
require_same_wire_format);
}
@@ -345,22 +455,26 @@ void ConformanceTestSuite::VerifyResponse(
ABSL_CHECK(reference_message->ParseFromString(equivalent_wire_format))
<< "Failed to parse wire data for test case: " << test_name;
+ TestStatus test;
+ test.set_name(test_name);
+
switch (response.result_case()) {
case ConformanceResponse::RESULT_NOT_SET:
- ReportFailure(test_name, level, request, response,
- "Response didn't have any field in the Response.");
+ test.set_failure_message(
+ "Response didn't have any field in the Response.");
+ ReportFailure(test, level, request, response);
return;
case ConformanceResponse::kParseError:
case ConformanceResponse::kTimeoutError:
case ConformanceResponse::kRuntimeError:
case ConformanceResponse::kSerializeError:
- ReportFailure(test_name, level, request, response,
- "Failed to parse input or produce output.");
+ test.set_failure_message("Failed to parse input or produce output.");
+ ReportFailure(test, level, request, response);
return;
case ConformanceResponse::kSkipped:
- ReportSkip(test_name, request, response);
+ ReportSkip(test, request, response);
return;
default:
@@ -386,20 +500,18 @@ void ConformanceTestSuite::VerifyResponse(
} else {
check = differencer.Compare(*reference_message, *test_message);
}
-
if (check) {
if (need_report_success) {
- ReportSuccess(test_name);
+ ReportSuccess(test);
}
} else {
- ReportFailure(
- test_name, level, request, response,
- absl::StrCat("Output was not equivalent to reference message: ",
- differences));
+ test.set_failure_message(absl::StrCat(
+ "Output was not equivalent to reference message: ", differences));
+ ReportFailure(test, level, request, response);
}
}
-void ConformanceTestSuite::RunTest(const std::string& test_name,
+bool ConformanceTestSuite::RunTest(const std::string& test_name,
const ConformanceRequest& request,
ConformanceResponse* response) {
if (test_names_.insert(test_name).second == false) {
@@ -410,7 +522,43 @@ void ConformanceTestSuite::RunTest(const std::string& test_name,
std::string serialized_response;
request.SerializeToString(&serialized_request);
- runner_->RunTest(test_name, serialized_request, &serialized_response);
+ uint32_t len = internal::little_endian::FromHost(
+ static_cast(serialized_request.size()));
+
+ if (!debug_) { // Not in debug mode. Continue.
+ } else if (debug_test_names_->erase(test_name) == 1) {
+ std::string octal = ProduceOctalSerialized(serialized_request, len);
+ std::string full_filename = WriteToFile(octal, output_dir_, test_name);
+ if (!full_filename.empty()) {
+ absl::StrAppendFormat(
+ &output_, "Produced octal serialized request file for test %s\n",
+ test_name);
+ absl::StrAppendFormat(
+ &output_,
+ " To pipe the "
+ "serialized request directly to "
+ "the "
+ "testee run from the root of your workspace:\n printf $("
+ "<\"%s\") | "
+ "./bazel-bin/google/protobuf/conformance/%s\n\n",
+ full_filename, testee_);
+ absl::StrAppendFormat(
+ &output_,
+ " To inspect the wire format of the serialized request run "
+ "(Disclaimer: This may not work properly on non-Linux platforms):\n "
+ " "
+ "contents=$(<\"%s\"); sub=$(cut -d \\\\ -f 6- <<< "
+ "$contents) ; printf \"\\\\${sub}\" | protoscope \n\n\n",
+ full_filename);
+ }
+ } else { // Test is not ran, as it was not asked to be debugged.
+ expected_to_fail_.erase(test_name);
+ return false;
+ }
+
+ response->set_protobuf_payload(serialized_request);
+
+ runner_->RunTest(test_name, len, serialized_request, &serialized_response);
if (!response->ParseFromString(serialized_response)) {
response->Clear();
@@ -423,6 +571,7 @@ void ConformanceTestSuite::RunTest(const std::string& test_name,
test_name, TruncateRequest(request).ShortDebugString(),
TruncateResponse(*response).ShortDebugString());
}
+ return true;
}
std::string ConformanceTestSuite::WireFormatToString(WireFormat wire_format) {
@@ -443,8 +592,8 @@ std::string ConformanceTestSuite::WireFormatToString(WireFormat wire_format) {
return "";
}
-void ConformanceTestSuite::AddExpectedFailedTest(const std::string& test_name) {
- expected_to_fail_.insert(test_name);
+void ConformanceTestSuite::AddExpectedFailedTest(const TestStatus& failure) {
+ expected_to_fail_[failure.name()] = failure;
}
bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
@@ -459,46 +608,89 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
unexpected_failing_tests_.clear();
unexpected_succeeding_tests_.clear();
- output_ = "\nCONFORMANCE TEST BEGIN ====================================\n\n";
+ std::string mode = debug_ ? "DEBUG" : "TEST";
+ absl::StrAppendFormat(
+ &output_, "CONFORMANCE %s BEGIN ====================================\n\n",
+ mode);
failure_list_filename_ = filename;
expected_to_fail_.clear();
- for (const std::string& failure : failure_list->failure()) {
+ for (const TestStatus& failure : failure_list->test()) {
AddExpectedFailedTest(failure);
}
RunSuiteImpl();
+ if (*output_dir_.rbegin() != '/') {
+ output_dir_.push_back('/');
+ }
+
bool ok = true;
if (!CheckSetEmpty(
expected_to_fail_, "nonexistent_tests.txt",
- absl::StrCat("These tests were listed in the failure list, but they "
- "don't exist. Remove them from the failure list by "
- "running:\n"
- " ./update_failure_list.py ",
- failure_list_filename_,
- " --remove nonexistent_tests.txt"),
+ absl::StrCat(
+ "These tests were listed in the failure list, but they "
+ "don't exist. Remove them from the failure list by "
+ "running from the root of your workspace:\n"
+ " bazel run "
+ "//google/protobuf/conformance:update_failure_list -- ",
+ failure_list_filename_, " --remove ", output_dir_,
+ "nonexistent_tests.txt"),
+ output_dir_, &output_)) {
+ ok = false;
+ }
+ if (!CheckSetEmpty(
+ expected_failure_messages_, "expected_failure_messages.txt",
+ absl::StrCat(
+ "These tests were listed in the failure list, but their failure "
+ "messages do not match. Remove them from the failure list "
+ "by running:\n"
+ " bazel run ",
+ "//google/protobuf/conformance:update_failure_list -- ",
+ failure_list_filename_, " --remove ", output_dir_,
+ "expected_failure_messages.txt"),
output_dir_, &output_)) {
ok = false;
}
+ if (!CheckSetEmpty(
+ unexpected_failure_messages_, "unexpected_failure_messages.txt",
+ absl::StrCat(
+ "These tests failed because their failure messages did "
+ "not match. If they can't be fixed right now, "
+ "you can add them to the failure list so the overall "
+ "suite can succeed. Add them to the failure list by "
+ "running from the root of your workspace:\n"
+ " bazel run "
+ "//google/protobuf/conformance:update_failure_list -- ",
+ failure_list_filename_, " --add ", output_dir_,
+ "unexpected_failure_messages.txt"),
+ output_dir_, &output_)) {
+ ok = false;
+ }
+
if (!CheckSetEmpty(
unexpected_failing_tests_, "failing_tests.txt",
- absl::StrCat("These tests failed. If they can't be fixed right now, "
- "you can add them to the failure list so the overall "
- "suite can succeed. Add them to the failure list by "
- "running:\n"
- " ./update_failure_list.py ",
- failure_list_filename_, " --add failing_tests.txt"),
+ absl::StrCat(
+ "These tests failed. If they can't be fixed right now, "
+ "you can add them to the failure list so the overall "
+ "suite can succeed. Add them to the failure list by "
+ "running from the root of your workspace:\n"
+ " bazel run "
+ "//google/protobuf/conformance:update_failure_list -- ",
+ failure_list_filename_, " --add ", output_dir_,
+ "failing_tests.txt"),
output_dir_, &output_)) {
ok = false;
}
if (!CheckSetEmpty(
unexpected_succeeding_tests_, "succeeding_tests.txt",
- absl::StrCat("These tests succeeded, even though they were listed in "
- "the failure list. Remove them from the failure list "
- "by running:\n"
- " ./update_failure_list.py ",
- failure_list_filename_,
- " --remove succeeding_tests.txt"),
+ absl::StrCat(
+ "These tests succeeded, even though they were listed in "
+ "the failure list. Remove them from the failure list by running "
+ "from the root of your workspace:\n"
+ " bazel run "
+ "//google/protobuf/conformance:update_failure_list -- ",
+ failure_list_filename_, " --remove ", output_dir_,
+ "succeeding_tests.txt"),
output_dir_, &output_)) {
ok = false;
}
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h
index c78f9ea8ab..d10c9836a9 100644
--- a/conformance/conformance_test.h
+++ b/conformance/conformance_test.h
@@ -15,18 +15,17 @@
#define CONFORMANCE_CONFORMANCE_TEST_H
#include
+#include
#include
#include
#include
#include "google/protobuf/descriptor.pb.h"
-#include "google/protobuf/util/type_resolver.h"
-#include "absl/container/btree_set.h"
+#include "absl/container/btree_map.h"
#include "absl/container/flat_hash_set.h"
-#include "absl/strings/string_view.h"
+#include "conformance/conformance.pb.h"
#include "conformance/conformance.pb.h"
#include "google/protobuf/descriptor.h"
-#include "google/protobuf/wire_format_lite.h"
namespace conformance {
class ConformanceRequest;
@@ -46,17 +45,18 @@ class ConformanceTestSuite;
class ConformanceTestRunner {
public:
- virtual ~ConformanceTestRunner() {}
+ virtual ~ConformanceTestRunner() = default;
// Call to run a single conformance test.
//
+ // "len" is the byte length of a serialized conformance.ConformanceRequest.
// "input" is a serialized conformance.ConformanceRequest.
// "output" should be set to a serialized conformance.ConformanceResponse.
//
// If there is any error in running the test itself, set "runtime_error" in
// the response.
- virtual void RunTest(const std::string& test_name, const std::string& input,
- std::string* output) = 0;
+ virtual void RunTest(const std::string& test_name, uint32_t len,
+ const std::string& input, std::string* output) = 0;
};
// Test runner that spawns the process being tested and communicates with it
@@ -78,10 +78,10 @@ class ForkPipeRunner : public ConformanceTestRunner {
explicit ForkPipeRunner(const std::string& executable)
: child_pid_(-1), executable_(executable) {}
- virtual ~ForkPipeRunner() {}
+ ~ForkPipeRunner() override = default;
- void RunTest(const std::string& test_name, const std::string& request,
- std::string* response);
+ void RunTest(const std::string& test_name, uint32_t len,
+ const std::string& request, std::string* response) override;
private:
void SpawnTestProgram();
@@ -129,12 +129,15 @@ class ForkPipeRunner : public ConformanceTestRunner {
class ConformanceTestSuite {
public:
ConformanceTestSuite()
- : verbose_(false),
+ : testee_(""),
+ verbose_(false),
performance_(false),
enforce_recommended_(false),
maximum_edition_(Edition::EDITION_PROTO3),
- failure_list_flag_name_("--failure_list") {}
- virtual ~ConformanceTestSuite() {}
+ failure_list_flag_name_("--failure_list"),
+ debug_test_names_(nullptr),
+ debug_(false) {}
+ virtual ~ConformanceTestSuite() = default;
void SetPerformance(bool performance) { performance_ = performance; }
void SetVerbose(bool verbose) { verbose_ = verbose; }
@@ -161,7 +164,18 @@ class ConformanceTestSuite {
}
// Sets the path of the output directory.
- void SetOutputDir(const char* output_dir) { output_dir_ = output_dir; }
+ void SetOutputDir(const std::string& output_dir) { output_dir_ = output_dir; }
+
+ // Sets if we are running the test in debug mode.
+ void SetDebug(bool debug) { debug_ = debug; }
+
+ // Sets the testee name
+ void SetTestee(const std::string& testee) { testee_ = testee; }
+
+ // Sets the debug test names
+ void SetDebugTestNames(absl::flat_hash_set& debug_test_names) {
+ debug_test_names_ = &debug_test_names;
+ }
// Run all the conformance tests against the given test runner.
// Test output will be stored in "output".
@@ -170,6 +184,9 @@ class ConformanceTestSuite {
// failure list.
// The filename here is *only* used to create/format useful error messages for
// how to update the failure list. We do NOT read this file at all.
+
+ // "debug_test_names" holds the list of test names that the user requested to
+ // debug. If this is empty, we will run all the tests.
bool RunSuite(ConformanceTestRunner* runner, std::string* output,
const std::string& filename,
conformance::FailureSet* failure_list);
@@ -201,7 +218,7 @@ class ConformanceTestSuite {
const Message& prototype_message,
const std::string& test_name,
const std::string& input);
- virtual ~ConformanceRequestSetting() {}
+ virtual ~ConformanceRequestSetting() = default;
std::unique_ptr NewTestMessage() const;
@@ -259,12 +276,11 @@ class ConformanceTestSuite {
conformance::ConformanceResponse TruncateResponse(
const conformance::ConformanceResponse& response);
- void ReportSuccess(const std::string& test_name);
- void ReportFailure(const std::string& test_name, ConformanceLevel level,
+ void ReportSuccess(const conformance::TestStatus& test);
+ void ReportFailure(conformance::TestStatus& test, ConformanceLevel level,
const conformance::ConformanceRequest& request,
- const conformance::ConformanceResponse& response,
- absl::string_view message);
- void ReportSkip(const std::string& test_name,
+ const conformance::ConformanceResponse& response);
+ void ReportSkip(const conformance::TestStatus& test,
const conformance::ConformanceRequest& request,
const conformance::ConformanceResponse& response);
@@ -274,15 +290,17 @@ class ConformanceTestSuite {
const std::string& equivalent_wire_format,
bool require_same_wire_format = false);
- void RunTest(const std::string& test_name,
+ // Returns true if our runner_ ran the test and false if it did not.
+ bool RunTest(const std::string& test_name,
const conformance::ConformanceRequest& request,
conformance::ConformanceResponse* response);
- void AddExpectedFailedTest(const std::string& test_name);
+ void AddExpectedFailedTest(const conformance::TestStatus& failure);
virtual void RunSuiteImpl() = 0;
ConformanceTestRunner* runner_;
+ std::string testee_;
int successes_;
int expected_failures_;
bool verbose_;
@@ -293,23 +311,41 @@ class ConformanceTestSuite {
std::string output_dir_;
std::string failure_list_flag_name_;
std::string failure_list_filename_;
+ absl::flat_hash_set* debug_test_names_;
+ bool debug_;
// The set of test names that are expected to fail in this run, but haven't
// failed yet.
- absl::btree_set expected_to_fail_;
+ absl::btree_map expected_to_fail_;
+
+ // The set of tests that failed because their failure message did not match
+ // the actual failure message. These are failure messages that may need to be
+ // removed from our failure lists.
+ absl::btree_map
+ expected_failure_messages_;
// The set of test names that have been run. Used to ensure that there are no
// duplicate names in the suite.
absl::flat_hash_set test_names_;
- // The set of tests that failed, but weren't expected to.
- absl::btree_set unexpected_failing_tests_;
+ // The set of tests that failed, but weren't expected to: They weren't
+ // present in our failure lists.
+ absl::btree_map
+ unexpected_failing_tests_;
+
+ // The set of tests that succeeded, but weren't expected to: They were present
+ // in our failure lists, but managed to succeed.
+ absl::btree_map
+ unexpected_succeeding_tests_;
- // The set of tests that succeeded, but weren't expected to.
- absl::btree_set unexpected_succeeding_tests_;
+ // The set of tests that failed because their failure message did not match
+ // the actual failure message. These are failure messages that may need to be
+ // added to our failure lists.
+ absl::btree_map
+ unexpected_failure_messages_;
// The set of tests that the testee opted out of;
- absl::btree_set skipped_;
+ absl::btree_map skipped_;
};
} // namespace protobuf
diff --git a/conformance/conformance_test_runner.cc b/conformance/conformance_test_runner.cc
index 35c33c63d7..3fbd9e2d44 100644
--- a/conformance/conformance_test_runner.cc
+++ b/conformance/conformance_test_runner.cc
@@ -32,26 +32,32 @@
#include
#include
+#include
#include
#include
#include
#include
+#include
+#include
#include
#include
#include
#include
#include
+#include
#include
+#include "absl/container/flat_hash_set.h"
#include "absl/log/absl_log.h"
+#include "absl/strings/ascii.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "conformance/conformance.pb.h"
+#include "conformance/conformance.pb.h"
#include "conformance_test.h"
#include "google/protobuf/endian.h"
-using conformance::ConformanceResponse;
using google::protobuf::ConformanceTestSuite;
using std::string;
using std::vector;
@@ -76,15 +82,34 @@ void ParseFailureList(const char *filename,
exit(1);
}
- for (string line; getline(infile, line);) {
- // Remove whitespace.
- line.erase(std::remove_if(line.begin(), line.end(), ::isspace), line.end());
-
+ for (string line; std::getline(infile, line);) {
// Remove comments.
- line = line.substr(0, line.find("#"));
+ string test_name = line.substr(0, line.find('#'));
+
+ test_name.erase(
+ std::remove_if(test_name.begin(), test_name.end(), ::isspace),
+ test_name.end());
- if (!line.empty()) {
- failure_list->add_failure(line);
+ if (test_name.empty()) { // Skip empty lines.
+ continue;
+ }
+
+ // If we remove whitespace from the beginning of a line, and what we have
+ // left at first is a '#', then we have a comment.
+ if (test_name[0] != '#') {
+ // Find our failure message if it exists. Will be set to an empty string
+ // if no message is found. Empty failure messages also pass our tests.
+ size_t check_message = line.find('#');
+ string message;
+ if (check_message != std::string::npos) {
+ message = line.substr(check_message + 1); // +1 to skip the delimiter
+ // If we had only whitespace after the delimiter, we will have an empty
+ // failure message and the test will still pass.
+ message = std::string(absl::StripAsciiWhitespace(message));
+ }
+ conformance::TestStatus *test = failure_list->add_test();
+ test->set_name(test_name);
+ test->set_failure_message(message);
}
}
}
@@ -100,7 +125,7 @@ void UsageError() {
fprintf(stderr,
" should contain one test name per\n");
fprintf(stderr,
- " line. Use '#' for comments.\n");
+ " line. Use '#' for comments.\n\n");
fprintf(stderr,
" --text_format_failure_list Use to specify list \n");
fprintf(stderr,
@@ -111,7 +136,7 @@ void UsageError() {
fprintf(stderr,
" File should contain one test name \n");
fprintf(stderr,
- " per line. Use '#' for comments.\n");
+ " per line. Use '#' for comments.\n\n");
fprintf(stderr,
" --enforce_recommended Enforce that recommended test\n");
@@ -121,19 +146,30 @@ void UsageError() {
" this flag if you want to be\n");
fprintf(stderr,
" strictly conforming to protobuf\n");
- fprintf(stderr, " spec.\n");
+ fprintf(stderr, " spec.\n\n");
fprintf(stderr,
- " --maximum_edition Only run conformance tests up\n");
+ " --maximum_edition Only run conformance tests up to\n");
fprintf(stderr,
- " to and including the specified\n");
- fprintf(stderr, " edition.\n");
+ " and including the specified\n");
+ fprintf(stderr, " edition.\n\n");
fprintf(stderr,
" --output_dir Directory to write\n"
- " output files.\n");
+ " output files.\n\n");
+ fprintf(stderr,
+ " --debug ... Debug the \n");
+ fprintf(stderr, " specified tests by running\n");
+ fprintf(stderr,
+ " them in isolation and producing\n");
+ fprintf(stderr,
+ " serialized request data for piping\n");
+ fprintf(stderr, " directly to the testee.\n\n");
+ fprintf(stderr, " --performance Boolean option\n");
+ fprintf(stderr, " for enabling run of\n");
+ fprintf(stderr, " performance tests.\n");
exit(1);
}
-void ForkPipeRunner::RunTest(const std::string &test_name,
+void ForkPipeRunner::RunTest(const std::string &test_name, uint32_t len,
const std::string &request,
std::string *response) {
if (child_pid_ < 0) {
@@ -141,8 +177,6 @@ void ForkPipeRunner::RunTest(const std::string &test_name,
}
current_test_name_ = test_name;
- uint32_t len =
- internal::little_endian::FromHost(static_cast(request.size()));
CheckedWrite(write_fd_, &len, sizeof(uint32_t));
CheckedWrite(write_fd_, request.c_str(), request.size());
@@ -188,57 +222,97 @@ int ForkPipeRunner::Run(int argc, char *argv[],
fprintf(stderr, "No test suites found.\n");
return EXIT_FAILURE;
}
+
+ string program;
+ string testee;
+ std::vector program_args;
+ bool performance = false;
+ bool debug = false;
+ absl::flat_hash_set debug_test_names;
+ bool enforce_recommended = false;
+ Edition maximum_edition = EDITION_UNKNOWN;
+ std::string output_dir;
+ bool verbose = false;
+
+ for (int arg = 1; arg < argc; ++arg) {
+ if (strcmp(argv[arg], "--performance") == 0) {
+ performance = true;
+ } else if (strcmp(argv[arg], "--verbose") == 0) {
+ verbose = true;
+ } else if (strcmp(argv[arg], "--enforce_recommended") == 0) {
+ enforce_recommended = true;
+ } else if (strcmp(argv[arg], "--maximum_edition") == 0) {
+ if (++arg == argc) UsageError();
+ Edition edition = EDITION_UNKNOWN;
+ if (!Edition_Parse(absl::StrCat("EDITION_", argv[arg]), &edition)) {
+ fprintf(stderr, "Unknown edition: %s\n", argv[arg]);
+ UsageError();
+ }
+ maximum_edition = edition;
+ } else if (strcmp(argv[arg], "--output_dir") == 0) {
+ if (++arg == argc) UsageError();
+ output_dir = argv[arg];
+
+ } else if (strcmp(argv[arg], "--debug") == 0) {
+ if (++arg == argc) UsageError();
+ for (int debug_arg = arg; debug_arg < argc; ++debug_arg) {
+ // Stop when we either find another flag or we reach the last arg
+ // (program arg)
+ if (argv[debug_arg][0] == '-' || debug_arg == argc - 1) {
+ arg = debug_arg - 1;
+ break;
+ }
+ debug_test_names.insert(argv[debug_arg]);
+ }
+
+ } else if (argv[arg][0] == '-') {
+ bool recognized_flag = false;
+ for (ConformanceTestSuite *suite : suites) {
+ if (strcmp(argv[arg], suite->GetFailureListFlagName().c_str()) == 0) {
+ if (++arg == argc) UsageError();
+ recognized_flag = true;
+ }
+ }
+ if (!recognized_flag) {
+ fprintf(stderr, "Unknown option: %s\n", argv[arg]);
+ UsageError();
+ }
+ } else {
+ program += argv[arg++];
+ while (arg < argc) {
+ program_args.push_back(argv[arg]);
+ arg++;
+ }
+ }
+ }
+
+ if (!debug_test_names.empty()) {
+ debug = true;
+ }
+ auto last_slash = program.find_last_of('/');
+ if (last_slash != string::npos) {
+ testee = program.substr(last_slash + 1);
+ }
+
bool all_ok = true;
for (ConformanceTestSuite *suite : suites) {
- string program;
- std::vector program_args;
string failure_list_filename;
conformance::FailureSet failure_list;
-
- bool performance = false;
for (int arg = 1; arg < argc; ++arg) {
if (strcmp(argv[arg], suite->GetFailureListFlagName().c_str()) == 0) {
if (++arg == argc) UsageError();
failure_list_filename = argv[arg];
ParseFailureList(argv[arg], &failure_list);
- } else if (strcmp(argv[arg], "--performance") == 0) {
- performance = true;
- suite->SetPerformance(true);
- } else if (strcmp(argv[arg], "--verbose") == 0) {
- suite->SetVerbose(true);
- } else if (strcmp(argv[arg], "--enforce_recommended") == 0) {
- suite->SetEnforceRecommended(true);
- } else if (strcmp(argv[arg], "--maximum_edition") == 0) {
- if (++arg == argc) UsageError();
- Edition edition = EDITION_UNKNOWN;
- if (!Edition_Parse(absl::StrCat("EDITION_", argv[arg]), &edition)) {
- fprintf(stderr, "Unknown edition: %s\n", argv[arg]);
- UsageError();
- }
- suite->SetMaximumEdition(edition);
- } else if (strcmp(argv[arg], "--output_dir") == 0) {
- if (++arg == argc) UsageError();
- suite->SetOutputDir(argv[arg]);
- } else if (argv[arg][0] == '-') {
- bool recognized_flag = false;
- for (ConformanceTestSuite *suite : suites) {
- if (strcmp(argv[arg], suite->GetFailureListFlagName().c_str()) == 0) {
- if (++arg == argc) UsageError();
- recognized_flag = true;
- }
- }
- if (!recognized_flag) {
- fprintf(stderr, "Unknown option: %s\n", argv[arg]);
- UsageError();
- }
- } else {
- program += argv[arg++];
- while (arg < argc) {
- program_args.push_back(argv[arg]);
- arg++;
- }
}
}
+ suite->SetPerformance(performance);
+ suite->SetVerbose(verbose);
+ suite->SetEnforceRecommended(enforce_recommended);
+ suite->SetMaximumEdition(maximum_edition);
+ suite->SetOutputDir(output_dir);
+ suite->SetDebug(debug);
+ suite->SetDebugTestNames(debug_test_names);
+ suite->SetTestee(testee);
ForkPipeRunner runner(program, program_args, performance);
@@ -248,6 +322,16 @@ int ForkPipeRunner::Run(int argc, char *argv[],
fwrite(output.c_str(), 1, output.size(), stderr);
}
+
+ if (!debug_test_names.empty()) {
+ fprintf(stderr,
+ "These tests were requested to be debugged, but they do "
+ "not exist. Revise the test names:\n\n");
+ for (const string &test_name : debug_test_names) {
+ fprintf(stderr, " %s\n", test_name.c_str());
+ }
+ fprintf(stderr, "\n\n");
+ }
return all_ok ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/conformance/failure_list_cpp.txt b/conformance/failure_list_cpp.txt
index 0f4e10ff63..d7ffba7274 100644
--- a/conformance/failure_list_cpp.txt
+++ b/conformance/failure_list_cpp.txt
@@ -7,105 +7,105 @@
# TODO: insert links to corresponding bugs tracking the issue.
# Should we use GitHub issues or the Google-internal bug tracker?
-Recommended.Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.Editions_Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.Proto3.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.Editions_Proto3.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.Proto3.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Editions_Proto3.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Editions_Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Proto3.JsonInput.FieldNameDuplicate
-Recommended.Editions_Proto3.JsonInput.FieldNameDuplicate
-Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1
-Recommended.Editions_Proto3.JsonInput.FieldNameDuplicateDifferentCasing1
-Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2
-Recommended.Editions_Proto3.JsonInput.FieldNameDuplicateDifferentCasing2
-Recommended.Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Editions_Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput
-Recommended.Editions_Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput
-Recommended.Editions_Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput
-Recommended.Editions_Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput
-Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput
-Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput
-Recommended.Proto3.JsonInput.MapFieldValueIsNull
-Recommended.Editions_Proto3.JsonInput.MapFieldValueIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingComma
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace
-Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter
-Recommended.Editions_Proto3.JsonInput.StringFieldUppercaseEscapeLetter
-Recommended.Proto3.JsonInput.TrailingCommaInAnObject
-Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObject
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines
-Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace
-Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithSpace
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
-Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
-Recommended.Proto2.JsonInput.FieldNameExtension.Validator
-Recommended.Editions_Proto2.JsonInput.FieldNameExtension.Validator
-Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Editions_Proto2.JsonInput.FieldNameDuplicate
-Recommended.Editions_Proto2.JsonInput.FieldNameDuplicateDifferentCasing1
-Recommended.Editions_Proto2.JsonInput.FieldNameDuplicateDifferentCasing2
-Recommended.Editions_Proto2.JsonInput.FieldNameNotQuoted
-Recommended.Editions_Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput
-Recommended.Editions_Proto2.JsonInput.MapFieldValueIsNull
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingComma
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithNewlines
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpace
-Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteKey
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteValue
-Recommended.Editions_Proto2.JsonInput.StringFieldUppercaseEscapeLetter
-Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObject
-Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithNewlines
-Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithSpace
-Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
-Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto2.JsonInput.FieldNameDuplicate
-Recommended.Proto2.JsonInput.FieldNameDuplicateDifferentCasing1
-Recommended.Proto2.JsonInput.FieldNameDuplicateDifferentCasing2
-Recommended.Proto2.JsonInput.FieldNameNotQuoted
-Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput
-Recommended.Proto2.JsonInput.MapFieldValueIsNull
-Recommended.Proto2.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Proto2.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Proto2.JsonInput.RepeatedFieldTrailingComma
-Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithNewlines
-Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpace
-Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto2.JsonInput.StringFieldUppercaseEscapeLetter
-Recommended.Proto2.JsonInput.TrailingCommaInAnObject
-Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithNewlines
-Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithSpace
-Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
+Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameDuplicateDifferentCasing1 # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameDuplicateDifferentCasing2 # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameExtension.Validator # Expected JSON payload but got type 1
+Recommended.Editions_Proto2.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key2]: FOO
+Recommended.Editions_Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key]: FOO
+Recommended.Editions_Proto2.JsonInput.MapFieldValueIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldMessageElementIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldPrimitiveElementIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingComma # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithNewlines # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldUppercaseEscapeLetter # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObject # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithNewlines # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.FieldMaskPathsDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.FieldMaskTooManyUnderscore.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldMaskInvalidCharacter # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameDuplicateDifferentCasing1 # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameDuplicateDifferentCasing2 # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key2]: FOO
+Recommended.Editions_Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key]: FOO
+Recommended.Editions_Proto3.JsonInput.MapFieldValueIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldMessageElementIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingComma # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldUppercaseEscapeLetter # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObject # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithSpace # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameDuplicateDifferentCasing1 # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameDuplicateDifferentCasing2 # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameExtension.Validator # Expected JSON payload but got type 1
+Recommended.Proto2.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key2]: FOO
+Recommended.Proto2.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key]: FOO
+Recommended.Proto2.JsonInput.MapFieldValueIsNull # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldMessageElementIsNull # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldPrimitiveElementIsNull # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldTrailingComma # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithNewlines # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpace # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldUppercaseEscapeLetter # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.TrailingCommaInAnObject # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithNewlines # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithSpace # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.FieldMaskPathsDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.FieldMaskTooManyUnderscore.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1 # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2 # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapPart.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key2]: FOO
+Recommended.Proto3.JsonInput.IgnoreUnknownEnumStringValueInMapValue.ProtobufOutput # Output was not equivalent to reference message: added: map_string_nested_enum[key]: FOO
+Recommended.Proto3.JsonInput.MapFieldValueIsNull # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.TrailingCommaInAnObject # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace # Should have failed to parse, but didn't.
diff --git a/conformance/failure_list_java.txt b/conformance/failure_list_java.txt
index ef705ef1b8..d8f44fde1f 100644
--- a/conformance/failure_list_java.txt
+++ b/conformance/failure_list_java.txt
@@ -4,149 +4,149 @@
# By listing them here we can keep tabs on which ones are failing and be sure
# that we don't introduce regressions in other tests.
-Recommended.Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.Proto3.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.Proto3.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse
-Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue
-Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse
-Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Proto3.JsonInput.FieldNameDuplicate
-Recommended.Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.JsonWithComments
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted
-Recommended.Proto2.JsonInput.FieldNameExtension.Validator
-Required.Proto3.JsonInput.EnumFieldNotQuoted
-Required.Proto3.JsonInput.Int32FieldLeadingZero
-Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero
-Required.Proto3.JsonInput.Int32FieldPlusSign
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Proto3.JsonInput.StringFieldNotAString
-Recommended.Proto2.JsonInput.BoolFieldAllCapitalFalse
-Recommended.Proto2.JsonInput.BoolFieldAllCapitalTrue
-Recommended.Proto2.JsonInput.BoolFieldCamelCaseFalse
-Recommended.Proto2.JsonInput.BoolFieldCamelCaseTrue
-Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto2.JsonInput.BoolMapFieldKeyNotQuoted
-Recommended.Proto2.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Proto2.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Proto2.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Proto2.JsonInput.FieldNameDuplicate
-Recommended.Proto2.JsonInput.FieldNameNotQuoted
-Recommended.Proto2.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Proto2.JsonInput.FloatFieldNanNotQuoted
-Recommended.Proto2.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Recommended.Proto2.JsonInput.Int32MapFieldKeyNotQuoted
-Recommended.Proto2.JsonInput.Int64MapFieldKeyNotQuoted
-Recommended.Proto2.JsonInput.JsonWithComments
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto2.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto2.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Proto2.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Proto2.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Proto2.JsonInput.Uint32MapFieldKeyNotQuoted
-Recommended.Proto2.JsonInput.Uint64MapFieldKeyNotQuoted
-Required.Proto2.JsonInput.EnumFieldNotQuoted
-Required.Proto2.JsonInput.Int32FieldLeadingZero
-Required.Proto2.JsonInput.Int32FieldNegativeWithLeadingZero
-Required.Proto2.JsonInput.Int32FieldPlusSign
-Required.Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
-Required.Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Proto2.JsonInput.StringFieldNotAString
-Recommended.Editions_Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.Editions_Proto3.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.Editions_Proto3.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Editions_Proto3.JsonInput.BoolFieldAllCapitalFalse
-Recommended.Editions_Proto3.JsonInput.BoolFieldAllCapitalTrue
-Recommended.Editions_Proto3.JsonInput.BoolFieldCamelCaseFalse
-Recommended.Editions_Proto3.JsonInput.BoolFieldCamelCaseTrue
-Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Editions_Proto3.JsonInput.BoolMapFieldKeyNotQuoted
-Recommended.Editions_Proto3.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Editions_Proto3.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Editions_Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Editions_Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Editions_Proto3.JsonInput.FieldNameDuplicate
-Recommended.Editions_Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Editions_Proto3.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Editions_Proto3.JsonInput.FloatFieldNanNotQuoted
-Recommended.Editions_Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Recommended.Editions_Proto3.JsonInput.Int32MapFieldKeyNotQuoted
-Recommended.Editions_Proto3.JsonInput.Int64MapFieldKeyNotQuoted
-Recommended.Editions_Proto3.JsonInput.JsonWithComments
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Editions_Proto3.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Editions_Proto3.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Editions_Proto3.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Editions_Proto3.JsonInput.Uint32MapFieldKeyNotQuoted
-Recommended.Editions_Proto3.JsonInput.Uint64MapFieldKeyNotQuoted
-Recommended.Editions_Proto2.JsonInput.FieldNameExtension.Validator
-Required.Editions_Proto3.JsonInput.EnumFieldNotQuoted
-Required.Editions_Proto3.JsonInput.Int32FieldLeadingZero
-Required.Editions_Proto3.JsonInput.Int32FieldNegativeWithLeadingZero
-Required.Editions_Proto3.JsonInput.Int32FieldPlusSign
-Required.Editions_Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
-Required.Editions_Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Editions_Proto3.JsonInput.StringFieldNotAString
-Recommended.Editions_Proto2.JsonInput.BoolFieldAllCapitalFalse
-Recommended.Editions_Proto2.JsonInput.BoolFieldAllCapitalTrue
-Recommended.Editions_Proto2.JsonInput.BoolFieldCamelCaseFalse
-Recommended.Editions_Proto2.JsonInput.BoolFieldCamelCaseTrue
-Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Editions_Proto2.JsonInput.BoolMapFieldKeyNotQuoted
-Recommended.Editions_Proto2.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Editions_Proto2.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Editions_Proto2.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Editions_Proto2.JsonInput.FieldNameDuplicate
-Recommended.Editions_Proto2.JsonInput.FieldNameNotQuoted
-Recommended.Editions_Proto2.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Editions_Proto2.JsonInput.FloatFieldNanNotQuoted
-Recommended.Editions_Proto2.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Recommended.Editions_Proto2.JsonInput.Int32MapFieldKeyNotQuoted
-Recommended.Editions_Proto2.JsonInput.Int64MapFieldKeyNotQuoted
-Recommended.Editions_Proto2.JsonInput.JsonWithComments
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteKey
-Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteValue
-Recommended.Editions_Proto2.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Editions_Proto2.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Editions_Proto2.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Editions_Proto2.JsonInput.Uint32MapFieldKeyNotQuoted
-Recommended.Editions_Proto2.JsonInput.Uint64MapFieldKeyNotQuoted
-Required.Editions_Proto2.JsonInput.EnumFieldNotQuoted
-Required.Editions_Proto2.JsonInput.Int32FieldLeadingZero
-Required.Editions_Proto2.JsonInput.Int32FieldNegativeWithLeadingZero
-Required.Editions_Proto2.JsonInput.Int32FieldPlusSign
-Required.Editions_Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
-Required.Editions_Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Editions_Proto2.JsonInput.StringFieldNotAString
-Required.Editions_Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Editions_Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput
+Recommended.Editions_Proto2.JsonInput.BoolFieldAllCapitalFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldAllCapitalTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldCamelCaseFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldCamelCaseTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.BoolMapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.DoubleFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.DoubleFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.DoubleFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FieldNameExtension.Validator # Expected JSON payload but got type 1
+Recommended.Editions_Proto2.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FloatFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FloatFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.FloatFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.Int32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.Int64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.JsonWithComments # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldSurrogateInWrongOrder # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldUnpairedHighSurrogate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.StringFieldUnpairedLowSurrogate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.Uint32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto2.JsonInput.Uint64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.FieldMaskPathsDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.FieldMaskTooManyUnderscore.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldAllCapitalFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldAllCapitalTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldCamelCaseFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldCamelCaseTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.BoolMapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.DoubleFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.DoubleFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldMaskInvalidCharacter # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FloatFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FloatFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.Int32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.Int64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.JsonWithComments # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldSurrogateInWrongOrder # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldUnpairedHighSurrogate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.StringFieldUnpairedLowSurrogate # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.Uint32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.JsonInput.Uint64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldAllCapitalFalse # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldAllCapitalTrue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldCamelCaseFalse # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldCamelCaseTrue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.BoolMapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.DoubleFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.DoubleFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.DoubleFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FieldNameExtension.Validator # Expected JSON payload but got type 1
+Recommended.Proto2.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FloatFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FloatFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.FloatFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.Int32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.Int64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.JsonWithComments # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldSurrogateInWrongOrder # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldUnpairedHighSurrogate # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.StringFieldUnpairedLowSurrogate # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.Uint32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto2.JsonInput.Uint64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.FieldMaskNumbersDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.FieldMaskPathsDontRoundTrip.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.FieldMaskTooManyUnderscore.JsonOutput # Should have failed to serialize, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameDuplicate # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FieldNameNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.JsonWithComments # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.EnumFieldNotQuoted # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.Int32FieldLeadingZero # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.Int32FieldNegativeWithLeadingZero # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.Int32FieldPlusSign # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt # Should have failed to parse, but didn't.
+Required.Editions_Proto2.JsonInput.StringFieldNotAString # Should have failed to parse, but didn't.
+Required.Editions_Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Editions_Proto3.JsonInput.EnumFieldNotQuoted # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.Int32FieldLeadingZero # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.Int32FieldNegativeWithLeadingZero # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.Int32FieldPlusSign # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt # Should have failed to parse, but didn't.
+Required.Editions_Proto3.JsonInput.StringFieldNotAString # Should have failed to parse, but didn't.
+Required.Editions_Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Proto2.JsonInput.EnumFieldNotQuoted # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.Int32FieldLeadingZero # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.Int32FieldNegativeWithLeadingZero # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.Int32FieldPlusSign # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt # Should have failed to parse, but didn't.
+Required.Proto2.JsonInput.StringFieldNotAString # Should have failed to parse, but didn't.
+Required.Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Proto3.JsonInput.EnumFieldNotQuoted # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.Int32FieldLeadingZero # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.Int32FieldPlusSign # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt # Should have failed to parse, but didn't.
+Required.Proto3.JsonInput.StringFieldNotAString # Should have failed to parse, but didn't.
+Required.Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
\ No newline at end of file
diff --git a/conformance/failure_list_java_lite.txt b/conformance/failure_list_java_lite.txt
index 84606a5173..87a9758cba 100644
--- a/conformance/failure_list_java_lite.txt
+++ b/conformance/failure_list_java_lite.txt
@@ -4,11 +4,11 @@
# By listing them here we can keep tabs on which ones are failing and be sure
# that we don't introduce regressions in other tests.
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Editions_Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Editions_Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Editions_Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Editions_Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
\ No newline at end of file
+Required.Editions_Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Editions_Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Editions_Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Editions_Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
+Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE # Should have failed to parse, but didn't.
\ No newline at end of file
diff --git a/conformance/failure_list_objc.txt b/conformance/failure_list_objc.txt
index 463c3606b9..0dd4279587 100644
--- a/conformance/failure_list_objc.txt
+++ b/conformance/failure_list_objc.txt
@@ -1,7 +1,7 @@
# JSON input or output tests are skipped (in conformance_objc.m) as mobile
# platforms don't support JSON wire format to avoid code bloat.
-Required.Editions_Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Editions_Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput
-Required.Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput
+Required.Editions_Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Editions_Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Proto2.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
+Required.Proto3.ProtobufInput.UnknownOrdering.ProtobufOutput # Unknown field mismatch
diff --git a/conformance/text_format_conformance_suite.cc b/conformance/text_format_conformance_suite.cc
index a230fa3d08..508206f5eb 100644
--- a/conformance/text_format_conformance_suite.cc
+++ b/conformance/text_format_conformance_suite.cc
@@ -26,6 +26,7 @@
using conformance::ConformanceRequest;
using conformance::ConformanceResponse;
+using conformance::TestStatus;
using conformance::WireFormat;
using protobuf_test_messages::editions::TestAllTypesEdition2023;
using protobuf_test_messages::proto2::TestAllTypesProto2;
@@ -73,19 +74,22 @@ bool TextFormatConformanceTestSuite::ParseResponse(
const std::string& test_name = setting.GetTestName();
ConformanceLevel level = setting.GetLevel();
+ TestStatus test;
+ test.set_name(test_name);
switch (response.result_case()) {
case ConformanceResponse::kProtobufPayload: {
if (requested_output != conformance::PROTOBUF) {
- ReportFailure(test_name, level, request, response,
- absl::StrCat("Test was asked for ",
- WireFormatToString(requested_output),
- " output but provided PROTOBUF instead."));
+ test.set_failure_message(absl::StrCat(
+ "Test was asked for ", WireFormatToString(requested_output),
+ " output but provided PROTOBUF instead."));
+ ReportFailure(test, level, request, response);
return false;
}
if (!test_message->ParseFromString(response.protobuf_payload())) {
- ReportFailure(test_name, level, request, response,
- "Protobuf output we received from test was unparseable.");
+ test.set_failure_message(
+ "Protobuf output we received from test was unparseable.");
+ ReportFailure(test, level, request, response);
return false;
}
@@ -94,18 +98,17 @@ bool TextFormatConformanceTestSuite::ParseResponse(
case ConformanceResponse::kTextPayload: {
if (requested_output != conformance::TEXT_FORMAT) {
- ReportFailure(
- test_name, level, request, response,
- absl::StrCat("Test was asked for ",
- WireFormatToString(requested_output),
- " output but provided TEXT_FORMAT instead."));
+ test.set_failure_message(absl::StrCat(
+ "Test was asked for ", WireFormatToString(requested_output),
+ " output but provided TEXT_FORMAT instead."));
+ ReportFailure(test, level, request, response);
return false;
}
if (!ParseTextFormatResponse(response, setting, test_message)) {
- ReportFailure(
- test_name, level, request, response,
+ test.set_failure_message(
"TEXT_FORMAT output we received from test was unparseable.");
+ ReportFailure(test, level, request, response);
return false;
}
@@ -172,14 +175,19 @@ void TextFormatConformanceTestSuiteImpl::ExpectParseFailure(
setting.ConformanceLevelToString(level), ".",
setting.GetSyntaxIdentifier(), ".TextFormatInput.", test_name);
- suite_.RunTest(effective_test_name, request, &response);
+ if (!suite_.RunTest(effective_test_name, request, &response)) {
+ return;
+ }
+
+ TestStatus test;
+ test.set_name(effective_test_name);
if (response.result_case() == ConformanceResponse::kParseError) {
- suite_.ReportSuccess(effective_test_name);
+ suite_.ReportSuccess(test);
} else if (response.result_case() == ConformanceResponse::kSkipped) {
- suite_.ReportSkip(effective_test_name, request, response);
+ suite_.ReportSkip(test, request, response);
} else {
- suite_.ReportFailure(effective_test_name, level, request, response,
- "Should have failed to parse, but didn't.");
+ test.set_failure_message("Should have failed to parse, but didn't.");
+ suite_.ReportFailure(test, level, request, response);
}
}
diff --git a/conformance/text_format_failure_list_cpp.txt b/conformance/text_format_failure_list_cpp.txt
index fd2d7ada1f..d1d3cd2e76 100644
--- a/conformance/text_format_failure_list_cpp.txt
+++ b/conformance/text_format_failure_list_cpp.txt
@@ -1,40 +1,42 @@
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
-Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
-Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
-Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
-Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
-Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
-Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
-Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
-Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex
-Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Hex
-Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal
-Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Octal
-Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes
-Required.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes
-Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString
-Required.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes # Should have failed to parse, but didn't.
+Recommended.Editions_Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes # Should have failed to parse, but didn't.
+Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Hex # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Octal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString # Should have failed to parse, but didn't.
+
+# End up setting the high bit as a sign instead of failing to parse.
diff --git a/conformance/text_format_failure_list_java.txt b/conformance/text_format_failure_list_java.txt
index a035453944..d2611ccb10 100644
--- a/conformance/text_format_failure_list_java.txt
+++ b/conformance/text_format_failure_list_java.txt
@@ -1,20 +1,20 @@
-Recommended.Editions_Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput
-Recommended.Editions_Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput
-Recommended.Editions_Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput
-Recommended.Editions_Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput
-Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput
-Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput
-Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput
-Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.AnyField.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.AnyField.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Hex
-Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Octal
-Required.Proto3.TextFormatInput.AnyField.ProtobufOutput
-Required.Proto3.TextFormatInput.AnyField.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex
-Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal
+Recommended.Editions_Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Editions_Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Editions_Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Editions_Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput # TEXT_FORMAT output we received from test was unparseable.
+Required.Editions_Proto3.TextFormatInput.AnyField.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.AnyField.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Hex # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.StringFieldBadUTF8Octal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.AnyField.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.AnyField.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal # Should have failed to parse, but didn't.
diff --git a/conformance/text_format_failure_list_python.txt b/conformance/text_format_failure_list_python.txt
index 48abf4e55b..346852001c 100644
--- a/conformance/text_format_failure_list_python.txt
+++ b/conformance/text_format_failure_list_python.txt
@@ -1,99 +1,101 @@
# This is the list of text format conformance tests that are known to fail right
# now.
# TODO: These should be fixed.
-Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_f.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_f.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_f.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_f.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_f.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_f.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_f.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_f.TextFormatOutput
-Required.Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput
-Required.Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput
-Required.Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput
-Required.Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_f.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_f.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_double: -0
+Required.Editions_Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_double: -0
+Required.Editions_Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_f.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_f.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_double: -0
+Required.Proto3.TextFormatInput.NegDoubleFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_double: -0
+Required.Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.ProtobufOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.NegFloatFieldLargeNegativeExponentParsesAsNegZero.TextFormatOutput # Output was not equivalent to reference message: deleted: optional_float: -0
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+
+# Optional float interpreted as `inf`
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput # Output was not equivalent to reference message
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput # Output was not equivalent to reference message
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_f.ProtobufOutput # Output was not equivalent to reference message
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_f.TextFormatOutput # Output was not equivalent to reference message
+Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput # Output was not equivalent to reference message
+Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput # Output was not equivalent to reference message
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_f.ProtobufOutput # Output was not equivalent to reference message
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_f.TextFormatOutput # Output was not equivalent to reference message
diff --git a/conformance/text_format_failure_list_python_cpp.txt b/conformance/text_format_failure_list_python_cpp.txt
index fc233ed286..d3c827d8d5 100644
--- a/conformance/text_format_failure_list_python_cpp.txt
+++ b/conformance/text_format_failure_list_python_cpp.txt
@@ -1,72 +1,72 @@
-Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
diff --git a/conformance/text_format_failure_list_python_upb.txt b/conformance/text_format_failure_list_python_upb.txt
index 85da8a1660..476a557e27 100644
--- a/conformance/text_format_failure_list_python_upb.txt
+++ b/conformance/text_format_failure_list_python_upb.txt
@@ -1,75 +1,75 @@
# This is the list of text format conformance tests that are known to fail right
# now.
# TODO: These should be fixed.
-Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal
-Required.Proto3.TextFormatInput.FloatFieldNoOctal
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput
-Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
-Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Editions_Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanInt64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldLargerThanUint64_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMaxValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldMinValue_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegativeZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNegative_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZeroWithExponent_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoLeadingZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldNoNegativeOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldNoOctal # Should have failed to parse, but didn't.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooLarge_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldTooSmall_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithInt32Max_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldWithVeryPreciseNumber_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatFieldZero_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.ProtobufOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.FloatField_F.TextFormatOutput # Failed to parse input or produce output.
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput # Output was not equivalent to reference message: modified: optional_bytes: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\t
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
+Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput # Output was not equivalent to reference message: modified: optional_string: "\007\010\014\n\r\t\013?\\\'\"" -> "\007\010\014\n\r\
diff --git a/conformance/update_failure_list.py b/conformance/update_failure_list.py
index 639a8c26ed..917dba312b 100755
--- a/conformance/update_failure_list.py
+++ b/conformance/update_failure_list.py
@@ -8,6 +8,14 @@
"""Script to update a failure list file to add/remove failures.
+When adding, will attempt to place them in their correct lexicographical
+position relative to other test names. This requires that the failure list is
+already sorted. This does not guarantee that the tests will appear neatly one
+after the other, as there may be comments in between. If the failure list
+is not sorted, sorted blocks may be produced, but the list as a whole will not.
+Lastly, be wary of lists that have tests stripped from OSS; if you catch that
+a test was added inside a stripped block, you may need to move it out.
+
This is sort of like comm(1), except it recognizes comments and ignores them.
"""
@@ -19,32 +27,58 @@ parser.add_argument('filename', type=str, help='failure list file to update')
parser.add_argument('--add', dest='add_list', action='append')
parser.add_argument('--remove', dest='remove_list', action='append')
+DEFAULT_ALIGNMENT = 114
args = parser.parse_args()
add_set = set()
remove_set = set()
+# Adds test + failure message
for add_file in (args.add_list or []):
with open(add_file) as f:
for line in f:
add_set.add(line)
+# We only remove by name
for remove_file in (args.remove_list or []):
with open(remove_file) as f:
for line in f:
if line in add_set:
raise Exception("Asked to both add and remove test: " + line)
- remove_set.add(line.strip())
+ remove_set.add(line.split('#')[0].strip())
add_list = sorted(add_set, reverse=True)
with open(args.filename) as in_file:
- existing_list = in_file.read()
+ existing_list = in_file.read()
-with open(args.filename, "w") as f:
+with open(args.filename, 'w') as f:
for line in existing_list.splitlines(True):
- test = line.split("#")[0].strip()
- while len(add_list) > 0 and test > add_list[-1]:
+ test = line.split('#')[0].strip()
+ # As long as the tests we are adding appear lexicographically before our
+ # read test, put them first followed by our read test.
+ while add_list and test > add_list[-1]:
f.write(add_list.pop())
if test not in remove_set:
f.write(line)
+ # Any remaining tests are added at the end
+ while add_list:
+ f.write(add_list.pop())
+
+# Update our read of the existing file
+with open(args.filename, 'r') as f:
+ existing_list = f.read()
+
+# Actual alignment of failure messages to 'DEFAULT_ALIGNMENT'
+# If test name exceeds DEFAULT_ALIGNMENT, it cannot and will not be aligned.
+with open(args.filename, 'w') as f:
+ for line in existing_list.splitlines(True):
+ split = line.split('#', 1)
+ test = split[0].strip()
+ if len(split) > 1 and test:
+ message = split[1].lstrip()
+ spaces = ' ' * (DEFAULT_ALIGNMENT - len(test))
+ line = test + spaces + ' # ' + message
+ f.write(line)
+ else: # ignore blank lines/lines that do not have '#'/comments
+ f.write(line)
diff --git a/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs b/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs
index f8a073b938..29b19592a7 100644
--- a/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs
+++ b/csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs
@@ -25,32 +25,35 @@ namespace Conformance {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch1jb25mb3JtYW5jZS9jb25mb3JtYW5jZS5wcm90bxILY29uZm9ybWFuY2Ui",
- "HQoKRmFpbHVyZVNldBIPCgdmYWlsdXJlGAEgAygJIuMCChJDb25mb3JtYW5j",
- "ZVJlcXVlc3QSGgoQcHJvdG9idWZfcGF5bG9hZBgBIAEoDEgAEhYKDGpzb25f",
- "cGF5bG9hZBgCIAEoCUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRl",
- "eHRfcGF5bG9hZBgIIAEoCUgAEjgKF3JlcXVlc3RlZF9vdXRwdXRfZm9ybWF0",
- "GAMgASgOMhcuY29uZm9ybWFuY2UuV2lyZUZvcm1hdBIUCgxtZXNzYWdlX3R5",
- "cGUYBCABKAkSMAoNdGVzdF9jYXRlZ29yeRgFIAEoDjIZLmNvbmZvcm1hbmNl",
- "LlRlc3RDYXRlZ29yeRI+ChVqc3BiX2VuY29kaW5nX29wdGlvbnMYBiABKAsy",
- "Hy5jb25mb3JtYW5jZS5Kc3BiRW5jb2RpbmdDb25maWcSHAoUcHJpbnRfdW5r",
- "bm93bl9maWVsZHMYCSABKAhCCQoHcGF5bG9hZCL6AQoTQ29uZm9ybWFuY2VS",
- "ZXNwb25zZRIVCgtwYXJzZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6ZV9l",
- "cnJvchgGIAEoCUgAEhcKDXRpbWVvdXRfZXJyb3IYCSABKAlIABIXCg1ydW50",
- "aW1lX2Vycm9yGAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgA",
- "EhYKDGpzb25fcGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIABIW",
- "Cgxqc3BiX3BheWxvYWQYByABKAlIABIWCgx0ZXh0X3BheWxvYWQYCCABKAlI",
- "AEIICgZyZXN1bHQiNwoSSnNwYkVuY29kaW5nQ29uZmlnEiEKGXVzZV9qc3Bi",
- "X2FycmF5X2FueV9mb3JtYXQYASABKAgqUAoKV2lyZUZvcm1hdBIPCgtVTlNQ",
- "RUNJRklFRBAAEgwKCFBST1RPQlVGEAESCAoESlNPThACEggKBEpTUEIQAxIP",
- "CgtURVhUX0ZPUk1BVBAEKo8BCgxUZXN0Q2F0ZWdvcnkSFAoQVU5TUEVDSUZJ",
- "RURfVEVTVBAAEg8KC0JJTkFSWV9URVNUEAESDQoJSlNPTl9URVNUEAISJAog",
- "SlNPTl9JR05PUkVfVU5LTk9XTl9QQVJTSU5HX1RFU1QQAxINCglKU1BCX1RF",
- "U1QQBBIUChBURVhUX0ZPUk1BVF9URVNUEAVCLwofY29tLmdvb2dsZS5wcm90",
- "b2J1Zi5jb25mb3JtYW5jZaICC0NvbmZvcm1hbmNlYgZwcm90bzM="));
+ "MwoKVGVzdFN0YXR1cxIMCgRuYW1lGAEgASgJEhcKD2ZhaWx1cmVfbWVzc2Fn",
+ "ZRgCIAEoCSI5CgpGYWlsdXJlU2V0EiUKBHRlc3QYAiADKAsyFy5jb25mb3Jt",
+ "YW5jZS5UZXN0U3RhdHVzSgQIARACIuMCChJDb25mb3JtYW5jZVJlcXVlc3QS",
+ "GgoQcHJvdG9idWZfcGF5bG9hZBgBIAEoDEgAEhYKDGpzb25fcGF5bG9hZBgC",
+ "IAEoCUgAEhYKDGpzcGJfcGF5bG9hZBgHIAEoCUgAEhYKDHRleHRfcGF5bG9h",
+ "ZBgIIAEoCUgAEjgKF3JlcXVlc3RlZF9vdXRwdXRfZm9ybWF0GAMgASgOMhcu",
+ "Y29uZm9ybWFuY2UuV2lyZUZvcm1hdBIUCgxtZXNzYWdlX3R5cGUYBCABKAkS",
+ "MAoNdGVzdF9jYXRlZ29yeRgFIAEoDjIZLmNvbmZvcm1hbmNlLlRlc3RDYXRl",
+ "Z29yeRI+ChVqc3BiX2VuY29kaW5nX29wdGlvbnMYBiABKAsyHy5jb25mb3Jt",
+ "YW5jZS5Kc3BiRW5jb2RpbmdDb25maWcSHAoUcHJpbnRfdW5rbm93bl9maWVs",
+ "ZHMYCSABKAhCCQoHcGF5bG9hZCL6AQoTQ29uZm9ybWFuY2VSZXNwb25zZRIV",
+ "CgtwYXJzZV9lcnJvchgBIAEoCUgAEhkKD3NlcmlhbGl6ZV9lcnJvchgGIAEo",
+ "CUgAEhcKDXRpbWVvdXRfZXJyb3IYCSABKAlIABIXCg1ydW50aW1lX2Vycm9y",
+ "GAIgASgJSAASGgoQcHJvdG9idWZfcGF5bG9hZBgDIAEoDEgAEhYKDGpzb25f",
+ "cGF5bG9hZBgEIAEoCUgAEhEKB3NraXBwZWQYBSABKAlIABIWCgxqc3BiX3Bh",
+ "eWxvYWQYByABKAlIABIWCgx0ZXh0X3BheWxvYWQYCCABKAlIAEIICgZyZXN1",
+ "bHQiNwoSSnNwYkVuY29kaW5nQ29uZmlnEiEKGXVzZV9qc3BiX2FycmF5X2Fu",
+ "eV9mb3JtYXQYASABKAgqUAoKV2lyZUZvcm1hdBIPCgtVTlNQRUNJRklFRBAA",
+ "EgwKCFBST1RPQlVGEAESCAoESlNPThACEggKBEpTUEIQAxIPCgtURVhUX0ZP",
+ "Uk1BVBAEKo8BCgxUZXN0Q2F0ZWdvcnkSFAoQVU5TUEVDSUZJRURfVEVTVBAA",
+ "Eg8KC0JJTkFSWV9URVNUEAESDQoJSlNPTl9URVNUEAISJAogSlNPTl9JR05P",
+ "UkVfVU5LTk9XTl9QQVJTSU5HX1RFU1QQAxINCglKU1BCX1RFU1QQBBIUChBU",
+ "RVhUX0ZPUk1BVF9URVNUEAVCLwofY29tLmdvb2dsZS5wcm90b2J1Zi5jb25m",
+ "b3JtYW5jZaICC0NvbmZvcm1hbmNlYgZwcm90bzM="));
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.TestStatus), global::Conformance.TestStatus.Parser, new[]{ "Name", "FailureMessage" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Conformance.FailureSet), global::Conformance.FailureSet.Parser, new[]{ "Test" }, 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", "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)
@@ -104,6 +107,246 @@ namespace Conformance {
#endregion
#region Messages
+ ///
+ /// Meant to encapsulate all types of tests: successes, skips, failures, etc.
+ /// Therefore, this may or may not have a failure message. Failure messages
+ /// may be truncated for our failure lists.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class TestStatus : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestStatus());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TestStatus() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TestStatus(TestStatus other) : this() {
+ name_ = other.name_;
+ failureMessage_ = other.failureMessage_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TestStatus Clone() {
+ return new TestStatus(this);
+ }
+
+ /// Field number for the "name" field.
+ public const int NameFieldNumber = 1;
+ private string name_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string Name {
+ get { return name_; }
+ set {
+ name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "failure_message" field.
+ public const int FailureMessageFieldNumber = 2;
+ private string failureMessage_ = "";
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string FailureMessage {
+ get { return failureMessage_; }
+ set {
+ failureMessage_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as TestStatus);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(TestStatus other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Name != other.Name) return false;
+ if (FailureMessage != other.FailureMessage) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Name.Length != 0) hash ^= Name.GetHashCode();
+ if (FailureMessage.Length != 0) hash ^= FailureMessage.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Name.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Name);
+ }
+ if (FailureMessage.Length != 0) {
+ output.WriteRawTag(18);
+ output.WriteString(FailureMessage);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Name.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Name);
+ }
+ if (FailureMessage.Length != 0) {
+ output.WriteRawTag(18);
+ output.WriteString(FailureMessage);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Name.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
+ }
+ if (FailureMessage.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(FailureMessage);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(TestStatus other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Name.Length != 0) {
+ Name = other.Name;
+ }
+ if (other.FailureMessage.Length != 0) {
+ FailureMessage = other.FailureMessage;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Name = input.ReadString();
+ break;
+ }
+ case 18: {
+ FailureMessage = input.ReadString();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ if ((tag & 7) == 4) {
+ // Abort on any end group tag.
+ return;
+ }
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ Name = input.ReadString();
+ break;
+ }
+ case 18: {
+ FailureMessage = input.ReadString();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
///
/// The conformance runner will request a list of failures as the first request.
/// This will be known by message_type == "conformance.FailureSet", a conformance
@@ -124,7 +367,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[0]; }
+ get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -144,7 +387,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FailureSet(FailureSet other) : this() {
- failure_ = other.failure_.Clone();
+ test_ = other.test_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
@@ -154,15 +397,15 @@ namespace Conformance {
return new FailureSet(this);
}
- /// Field number for the "failure" field.
- public const int FailureFieldNumber = 1;
- private static readonly pb::FieldCodec _repeated_failure_codec
- = pb::FieldCodec.ForString(10);
- private readonly pbc::RepeatedField failure_ = new pbc::RepeatedField();
+ /// Field number for the "test" field.
+ public const int TestFieldNumber = 2;
+ private static readonly pb::FieldCodec _repeated_test_codec
+ = pb::FieldCodec.ForMessage(18, global::Conformance.TestStatus.Parser);
+ private readonly pbc::RepeatedField test_ = new pbc::RepeatedField();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
- public pbc::RepeatedField Failure {
- get { return failure_; }
+ public pbc::RepeatedField Test {
+ get { return test_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -180,7 +423,7 @@ namespace Conformance {
if (ReferenceEquals(other, this)) {
return true;
}
- if(!failure_.Equals(other.failure_)) return false;
+ if(!test_.Equals(other.test_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
@@ -188,7 +431,7 @@ namespace Conformance {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
- hash ^= failure_.GetHashCode();
+ hash ^= test_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
@@ -207,7 +450,7 @@ namespace Conformance {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
- failure_.WriteTo(output, _repeated_failure_codec);
+ test_.WriteTo(output, _repeated_test_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
@@ -218,7 +461,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
- failure_.WriteTo(ref output, _repeated_failure_codec);
+ test_.WriteTo(ref output, _repeated_test_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
@@ -229,7 +472,7 @@ namespace Conformance {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
- size += failure_.CalculateSize(_repeated_failure_codec);
+ size += test_.CalculateSize(_repeated_test_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
@@ -242,7 +485,7 @@ namespace Conformance {
if (other == null) {
return;
}
- failure_.Add(other.failure_);
+ test_.Add(other.test_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
@@ -262,8 +505,8 @@ namespace Conformance {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
- case 10: {
- failure_.AddEntriesFrom(input, _repeated_failure_codec);
+ case 18: {
+ test_.AddEntriesFrom(input, _repeated_test_codec);
break;
}
}
@@ -285,8 +528,8 @@ namespace Conformance {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
- case 10: {
- failure_.AddEntriesFrom(ref input, _repeated_failure_codec);
+ case 18: {
+ test_.AddEntriesFrom(ref input, _repeated_test_codec);
break;
}
}
@@ -318,7 +561,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[1]; }
+ get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -945,7 +1188,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[2]; }
+ get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -1665,7 +1908,7 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
- get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[3]; }
+ get { return global::Conformance.ConformanceReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
diff --git a/editions/generated_files_test.cc b/editions/generated_files_test.cc
index 7a9b261391..22aaa18f8c 100644
--- a/editions/generated_files_test.cc
+++ b/editions/generated_files_test.cc
@@ -146,7 +146,11 @@ TEST(Generated, EditionDefaults2023InternalFeatures) {
utf8_validation: VERIFY
message_encoding: LENGTH_PREFIXED
json_format: ALLOW
- [pb.cpp] { legacy_closed_enum: false string_type: STRING }
+ [pb.cpp] {
+ legacy_closed_enum: false
+ string_type: STRING
+ enum_name_uses_string_view: false
+ }
)pb"));
}
diff --git a/editions/golden/compare_cpp_codegen_failure.txt b/editions/golden/compare_cpp_codegen_failure.txt
index ff5fbdaffc..ab0bad33f1 100644
--- a/editions/golden/compare_cpp_codegen_failure.txt
+++ b/editions/golden/compare_cpp_codegen_failure.txt
@@ -30,9 +30,9 @@
{
- // optional int32 int32_field = 1;
+ // int32 int32_field = 1;
- cached_has_bits =
- this_._impl_._has_bits_[0];
+ cached_has_bits = this_._impl_._has_bits_[0];
if (cached_has_bits & 0x00000001u) {
+ total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
[ FAILED ] third_party/protobuf/editions/golden/simple_proto3.pb.cc
[ RUN ] third_party/protobuf/editions/golden/simple_proto3.pb.h
@@ @@
diff --git a/editions/golden/compare_cpp_codegen_failure.xml b/editions/golden/compare_cpp_codegen_failure.xml
index 05caafb727..cb65ff53a6 100644
--- a/editions/golden/compare_cpp_codegen_failure.xml
+++ b/editions/golden/compare_cpp_codegen_failure.xml
@@ -2,10 +2,10 @@
-
+
-
+
diff --git a/hpb/BUILD b/hpb/BUILD
index 3f39415bc0..69587c7fdd 100644
--- a/hpb/BUILD
+++ b/hpb/BUILD
@@ -15,7 +15,7 @@ load(
)
# begin:google_only
-# package(default_applicable_licenses = ["//upb:license"])
+# package(default_applicable_licenses = ["//src/google/protobuf:license"])
# end:google_only
licenses(["notice"])
diff --git a/hpb/extension_lock_test.cc b/hpb/extension_lock_test.cc
index ef8013bdb8..81198082e1 100644
--- a/hpb/extension_lock_test.cc
+++ b/hpb/extension_lock_test.cc
@@ -36,11 +36,11 @@ std::string GenerateTestData() {
model.set_str1("str");
ThemeExtension extension1;
extension1.set_ext_name("theme");
- ABSL_CHECK_OK(::protos::SetExtension(&model, theme, extension1));
+ ABSL_CHECK_OK(::hpb::SetExtension(&model, theme, extension1));
ThemeExtension extension2;
extension2.set_ext_name("theme_extension");
- ABSL_CHECK_OK(::protos::SetExtension(&model, ThemeExtension::theme_extension,
- extension2));
+ ABSL_CHECK_OK(
+ ::hpb::SetExtension(&model, ThemeExtension::theme_extension, extension2));
::upb::Arena arena;
auto bytes = ::protos::Serialize(&model, arena);
ABSL_CHECK_OK(bytes);
@@ -54,7 +54,7 @@ void unlock_func(const void* msg) { m[absl::HashOf(msg) & 0x7].unlock(); }
return &unlock_func;
}
-void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) {
+void TestConcurrentExtensionAccess(::hpb::ExtensionRegistry registry) {
::hpb::internal::upb_extension_locker_global.store(&lock_func,
std::memory_order_release);
const std::string payload = GenerateTestData();
@@ -62,7 +62,7 @@ void TestConcurrentExtensionAccess(::protos::ExtensionRegistry registry) {
::protos::Parse(payload, registry).value();
const auto test_main = [&] { EXPECT_EQ("str", parsed_model.str1()); };
const auto test_theme = [&] {
- ASSERT_TRUE(::protos::HasExtension(&parsed_model, theme));
+ ASSERT_TRUE(::hpb::HasExtension(&parsed_model, theme));
auto ext = ::protos::GetExtension(&parsed_model, theme);
ASSERT_OK(ext);
EXPECT_EQ((*ext)->ext_name(), "theme");
diff --git a/hpb/hpb.cc b/hpb/hpb.cc
index d63c7d98d9..a170dbf6fa 100644
--- a/hpb/hpb.cc
+++ b/hpb/hpb.cc
@@ -27,7 +27,7 @@
#include "upb/wire/decode.h"
#include "upb/wire/encode.h"
-namespace protos {
+namespace hpb {
// begin:google_only
absl::Status MessageAllocationError(SourceLocation loc) {
@@ -83,10 +83,6 @@ absl::Status MessageDecodeError(upb_DecodeStatus status, SourceLocation loc
namespace internal {
-using ::hpb::internal::upb_extension_locker_global;
-using ::hpb::internal::UpbExtensionLocker;
-using ::hpb::internal::UpbExtensionUnlocker;
-
upb_ExtensionRegistry* GetUpbExtensions(
const ExtensionRegistry& extension_registry) {
return extension_registry.registry_;
@@ -186,4 +182,4 @@ absl::Status SetExtension(upb_Message* message, upb_Arena* message_arena,
} // namespace internal
-} // namespace protos
+} // namespace hpb
diff --git a/hpb/hpb.h b/hpb/hpb.h
index 8de8e249e8..f6b49f5347 100644
--- a/hpb/hpb.h
+++ b/hpb/hpb.h
@@ -8,11 +8,13 @@
#ifndef PROTOBUF_HPB_HPB_H_
#define PROTOBUF_HPB_HPB_H_
+#include
#include
#include
#include "absl/status/status.h"
#include "absl/status/statusor.h"
+#include "absl/strings/string_view.h"
#include "upb/base/status.hpp"
#include "upb/mem/arena.hpp"
#include "upb/message/copy.h"
@@ -21,12 +23,8 @@
#include "upb/wire/encode.h"
namespace hpb {
-using Arena = ::upb::Arena;
-}
-
-namespace protos {
-using hpb::Arena;
class ExtensionRegistry;
+using Arena = ::upb::Arena;
template
using Proxy = std::conditional_t::value,
@@ -85,6 +83,7 @@ class Ptr final {
template
Ptr(T* m) -> Ptr;
+// TODO: b/354766950 - Move upb-specific chunks out of hpb header
inline absl::string_view UpbStrToStringView(upb_StringView str) {
return absl::string_view(str.data, str.size);
}
@@ -98,12 +97,6 @@ inline upb_StringView UpbStrFromStringView(absl::string_view str,
return upb_StringView_FromDataAndSize(buffer, str_size);
}
-template
-typename T::Proxy CreateMessage(::protos::Arena& arena) {
- return typename T::Proxy(upb_Message_New(T::minitable(), arena.ptr()),
- arena.ptr());
-}
-
// begin:github_only
// // This type exists to work around an absl type that has not yet been
// // released.
@@ -131,6 +124,34 @@ absl::Status MessageEncodeError(upb_EncodeStatus status,
SourceLocation loc = SourceLocation::current());
namespace internal {
+template
+struct RemovePtr;
+
+template
+struct RemovePtr> {
+ using type = T;
+};
+
+template
+struct RemovePtr {
+ using type = T;
+};
+
+template
+using RemovePtrT = typename RemovePtr::type;
+
+template ,
+ typename = std::enable_if_t>>
+using PtrOrRaw = T;
+
+template
+using EnableIfHpbClass = std::enable_if_t<
+ std::is_base_of::value &&
+ std::is_base_of::value>;
+
+template
+using EnableIfMutableProto = std::enable_if_t::value>;
+
struct PrivateAccess {
template
static auto* GetInternalMsg(T&& message) {
@@ -148,6 +169,11 @@ struct PrivateAccess {
static auto CreateMessage(upb_Arena* arena) {
return typename T::Proxy(upb_Message_New(T::minitable(), arena), arena);
}
+
+ template
+ static constexpr uint32_t GetExtensionNumber(const ExtensionId& id) {
+ return id.number();
+ }
};
template
@@ -200,6 +226,12 @@ class ExtensionIdentifier : public ExtensionMiniTableProvider {
constexpr explicit ExtensionIdentifier(
const upb_MiniTableExtension* mini_table_ext)
: ExtensionMiniTableProvider(mini_table_ext) {}
+
+ private:
+ constexpr uint32_t number() const {
+ return upb_MiniTableExtension_Number(mini_table_ext());
+ }
+ friend class PrivateAccess;
};
template
@@ -249,82 +281,12 @@ absl::Status SetExtension(upb_Message* message, upb_Arena* message_arena,
const upb_MiniTableExtension* ext,
const upb_Message* extension);
-template
-struct RemovePtr;
-
-template
-struct RemovePtr> {
- using type = T;
-};
-
-template
-struct RemovePtr {
- using type = T;
-};
-
-template
-using RemovePtrT = typename RemovePtr::type;
-
-template ,
- typename = std::enable_if_t>>
-using PtrOrRaw = T;
-
-template
-using EnableIfHpbClass = std::enable_if_t<
- std::is_base_of::value &&
- std::is_base_of::value>;
-
-template
-using EnableIfMutableProto = std::enable_if_t::value>;
-
} // namespace internal
-template
-void DeepCopy(Ptr source_message, Ptr target_message) {
- static_assert(!std::is_const_v);
- ::protos::internal::DeepCopy(
- internal::GetInternalMsg(target_message),
- internal::GetInternalMsg(source_message), T::minitable(),
- static_cast(target_message->GetInternalArena()));
-}
-
-template
-typename T::Proxy CloneMessage(Ptr message, upb_Arena* arena) {
- return internal::PrivateAccess::Proxy(
- ::protos::internal::DeepClone(internal::GetInternalMsg(message),
- T::minitable(), arena),
- arena);
-}
-
-template
-void DeepCopy(Ptr source_message, T* target_message) {
- static_assert(!std::is_const_v);
- DeepCopy(source_message, protos::Ptr(target_message));
-}
-
-template
-void DeepCopy(const T* source_message, Ptr target_message) {
- static_assert(!std::is_const_v);
- DeepCopy(protos::Ptr(source_message), target_message);
-}
-
-template
-void DeepCopy(const T* source_message, T* target_message) {
- static_assert(!std::is_const_v);
- DeepCopy(protos::Ptr(source_message), protos::Ptr(target_message));
-}
-
-template
-void ClearMessage(internal::PtrOrRaw message) {
- auto ptr = Ptr(message);
- auto minitable = internal::GetMiniTable(ptr);
- upb_Message_Clear(internal::GetInternalMsg(ptr), minitable);
-}
-
class ExtensionRegistry {
public:
ExtensionRegistry(
- const std::vector&
+ const std::vector&
extensions,
const upb::Arena& arena)
: registry_(upb_ExtensionRegistry_New(arena.ptr())) {
@@ -341,151 +303,209 @@ class ExtensionRegistry {
}
private:
- friend upb_ExtensionRegistry* ::protos::internal::GetUpbExtensions(
+ friend upb_ExtensionRegistry* ::hpb::internal::GetUpbExtensions(
const ExtensionRegistry& extension_registry);
upb_ExtensionRegistry* registry_;
};
template >
+ typename = hpb::internal::EnableIfHpbClass>
ABSL_MUST_USE_RESULT bool HasExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id) {
- return ::protos::internal::HasExtensionOrUnknown(
- ::protos::internal::GetInternalMsg(message), id.mini_table_ext());
+ const ::hpb::internal::ExtensionIdentifier& id) {
+ return ::hpb::internal::HasExtensionOrUnknown(
+ ::hpb::internal::GetInternalMsg(message), id.mini_table_ext());
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
ABSL_MUST_USE_RESULT bool HasExtension(
const T* message,
- const ::protos::internal::ExtensionIdentifier& id) {
- return HasExtension(protos::Ptr(message), id);
+ const ::hpb::internal::ExtensionIdentifier& id) {
+ return HasExtension(Ptr(message), id);
}
template ,
- typename = internal::EnableIfMutableProto>
+ typename = hpb::internal::EnableIfHpbClass,
+ typename = hpb::internal::EnableIfMutableProto>
void ClearExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id) {
+ const ::hpb::internal::ExtensionIdentifier& id) {
static_assert(!std::is_const_v, "");
- upb_Message_ClearExtension(internal::GetInternalMsg(message),
+ upb_Message_ClearExtension(hpb::internal::GetInternalMsg(message),
id.mini_table_ext());
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
void ClearExtension(
- T* message,
- const ::protos::internal::ExtensionIdentifier& id) {
- ClearExtension(::protos::Ptr(message), id);
+ T* message, const ::hpb::internal::ExtensionIdentifier& id) {
+ ClearExtension(Ptr(message), id);
}
template ,
- typename = internal::EnableIfMutableProto>
+ typename = hpb::internal::EnableIfHpbClass,
+ typename = hpb::internal::EnableIfMutableProto>
absl::Status SetExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id,
+ const ::hpb::internal::ExtensionIdentifier& id,
const Extension& value) {
static_assert(!std::is_const_v);
auto* message_arena = static_cast(message->GetInternalArena());
- return ::protos::internal::SetExtension(internal::GetInternalMsg(message),
- message_arena, id.mini_table_ext(),
- internal::GetInternalMsg(&value));
+ return ::hpb::internal::SetExtension(hpb::internal::GetInternalMsg(message),
+ message_arena, id.mini_table_ext(),
+ hpb::internal::GetInternalMsg(&value));
}
template ,
- typename = internal::EnableIfMutableProto>
+ typename = hpb::internal::EnableIfHpbClass,
+ typename = hpb::internal::EnableIfMutableProto>
absl::Status SetExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id,
+ const ::hpb::internal::ExtensionIdentifier& id,
Ptr value) {
static_assert(!std::is_const_v);
auto* message_arena = static_cast(message->GetInternalArena());
- return ::protos::internal::SetExtension(internal::GetInternalMsg(message),
- message_arena, id.mini_table_ext(),
- internal::GetInternalMsg(value));
+ return ::hpb::internal::SetExtension(hpb::internal::GetInternalMsg(message),
+ message_arena, id.mini_table_ext(),
+ hpb::internal::GetInternalMsg(value));
}
template ,
- typename = internal::EnableIfMutableProto>
+ typename = hpb::internal::EnableIfHpbClass,
+ typename = hpb::internal::EnableIfMutableProto>
absl::Status SetExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id,
+ const ::hpb::internal::ExtensionIdentifier& id,
Extension&& value) {
Extension ext = std::move(value);
static_assert(!std::is_const_v);
auto* message_arena = static_cast(message->GetInternalArena());
auto* extension_arena = static_cast(ext.GetInternalArena());
- return ::protos::internal::MoveExtension(
- internal::GetInternalMsg(message), message_arena, id.mini_table_ext(),
- internal::GetInternalMsg(&ext), extension_arena);
+ return ::hpb::internal::MoveExtension(hpb::internal::GetInternalMsg(message),
+ message_arena, id.mini_table_ext(),
+ hpb::internal::GetInternalMsg(&ext),
+ extension_arena);
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
absl::Status SetExtension(
- T* message, const ::protos::internal::ExtensionIdentifier& id,
+ T* message, const ::hpb::internal::ExtensionIdentifier& id,
const Extension& value) {
- return ::protos::SetExtension(::protos::Ptr(message), id, value);
+ return ::hpb::SetExtension(Ptr(message), id, value);
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
absl::Status SetExtension(
- T* message, const ::protos::internal::ExtensionIdentifier& id,
+ T* message, const ::hpb::internal::ExtensionIdentifier& id,
Extension&& value) {
- return ::protos::SetExtension(::protos::Ptr(message), id,
- std::forward(value));
+ return ::hpb::SetExtension(Ptr(message), id, std::forward(value));
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
absl::Status SetExtension(
- T* message, const ::protos::internal::ExtensionIdentifier& id,
+ T* message, const ::hpb::internal::ExtensionIdentifier& id,
Ptr value) {
- return ::protos::SetExtension(::protos::Ptr(message), id, value);
+ return ::hpb::SetExtension(Ptr(message), id, value);
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
absl::StatusOr> GetExtension(
Ptr message,
- const ::protos::internal::ExtensionIdentifier& id) {
+ const ::hpb::internal::ExtensionIdentifier& id) {
// TODO: Fix const correctness issues.
upb_MessageValue value;
- const bool ok = ::protos::internal::GetOrPromoteExtension(
- const_cast(internal::GetInternalMsg(message)),
- id.mini_table_ext(), ::protos::internal::GetArena(message), &value);
+ const bool ok = ::hpb::internal::GetOrPromoteExtension(
+ const_cast(::hpb::internal::GetInternalMsg(message)),
+ id.mini_table_ext(), ::hpb::internal::GetArena(message), &value);
if (!ok) {
return ExtensionNotFoundError(
upb_MiniTableExtension_Number(id.mini_table_ext()));
}
- return Ptr(::protos::internal::CreateMessage(
- (upb_Message*)value.msg_val, ::protos::internal::GetArena(message)));
+ return Ptr(::hpb::internal::CreateMessage(
+ (upb_Message*)value.msg_val, ::hpb::internal::GetArena(message)));
}
template >
+ typename = hpb::internal::EnableIfHpbClass>
absl::StatusOr> GetExtension(
const T* message,
- const ::protos::internal::ExtensionIdentifier& id) {
- return GetExtension(protos::Ptr(message), id);
+ const ::hpb::internal::ExtensionIdentifier& id) {
+ return GetExtension(Ptr(message), id);
}
+template
+typename T::Proxy CreateMessage(::hpb::Arena& arena) {
+ return typename T::Proxy(upb_Message_New(T::minitable(), arena.ptr()),
+ arena.ptr());
+}
+
+template
+typename T::Proxy CloneMessage(Ptr message, upb_Arena* arena) {
+ return ::hpb::internal::PrivateAccess::Proxy