prototesting

package
v0.0.0-...-26f4575 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFileDescriptorSetsEqual

func AssertFileDescriptorSetsEqual(
	t *testing.T,
	runner command.Runner,
	one *descriptorpb.FileDescriptorSet,
	two *descriptorpb.FileDescriptorSet,
)

AssertFileDescriptorSetsEqual asserts that the FileDescriptorSet are equal for JSON and compare.

func DiffFileDescriptorSetsCompare

func DiffFileDescriptorSetsCompare(
	one *descriptorpb.FileDescriptorSet,
	two *descriptorpb.FileDescriptorSet,
) string

DiffFileDescriptorSetsCompare diffs the two FileDescriptorSets using the cmp package.

func DiffFileDescriptorSetsJSON

func DiffFileDescriptorSetsJSON(
	ctx context.Context,
	runner command.Runner,
	one *descriptorpb.FileDescriptorSet,
	two *descriptorpb.FileDescriptorSet,
	oneName string,
	twoName string,
) (string, error)

DiffFileDescriptorSetsJSON diffs the two FileDescriptorSets using JSON.

func DiffFileDescriptorSetsWire

func DiffFileDescriptorSetsWire(
	ctx context.Context,
	runner command.Runner,
	one *descriptorpb.FileDescriptorSet,
	two *descriptorpb.FileDescriptorSet,
	oneName string,
	twoName string,
) (string, error)

DiffFileDescriptorSetsWire diffs the two FileDescriptorSets using proto.MarshalWire.

func GetProtocFileDescriptorSet

func GetProtocFileDescriptorSet(
	ctx context.Context,
	runner command.Runner,
	roots []string,
	realFilePaths []string,
	includeImports bool,
	includeSourceInfo bool,
) (_ *descriptorpb.FileDescriptorSet, retErr error)

GetProtocFileDescriptorSet gets the validated FileDescriptorSet using protoc and the Well-Known Types on the current PATH.

Only use for testing.

func GetProtocVersion

func GetProtocVersion(ctx context.Context) (string, error)

GetProtocVersion runs protoc --version with RunProtoc and returns the output sans the "libprotoc" prefix

func RunProtoc

func RunProtoc(
	ctx context.Context,
	runner command.Runner,
	roots []string,
	realFilePaths []string,
	includeImports bool,
	includeSourceInfo bool,
	env map[string]string,
	stdout io.Writer,
	extraFlags ...string,
) error

RunProtoc runs protoc.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL