harness

package
v1.36.11-2026020920213... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TestResult_CompilationError_case case_TestResult_Result = 3
View Source
const TestResult_Result_not_set_case case_TestResult_Result = 0
View Source
const TestResult_RuntimeError_case case_TestResult_Result = 4
View Source
const TestResult_Success_case case_TestResult_Result = 1
View Source
const TestResult_UnexpectedError_case case_TestResult_Result = 5
View Source
const TestResult_ValidationError_case case_TestResult_Result = 2

Variables

View Source
var File_buf_validate_conformance_harness_harness_proto protoreflect.FileDescriptor
View Source
var File_buf_validate_conformance_harness_results_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CaseResult

type CaseResult struct {

	// The case name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Success state of the test case. True if the test case succeeded.
	Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	// The expected result.
	Wanted *TestResult `protobuf:"bytes,3,opt,name=wanted,proto3" json:"wanted,omitempty"`
	// The actual result.
	Got *TestResult `protobuf:"bytes,4,opt,name=got,proto3" json:"got,omitempty"`
	// The input used to invoke the test case.
	Input *anypb.Any `protobuf:"bytes,5,opt,name=input,proto3" json:"input,omitempty"`
	// Denotes if the test is expected to fail. True, if the test case was expected to fail.
	ExpectedFailure bool `protobuf:"varint,6,opt,name=expected_failure,json=expectedFailure,proto3" json:"expected_failure,omitempty"`
	// contains filtered or unexported fields
}

A case result is a single test case result.

func (*CaseResult) ClearGot

func (x *CaseResult) ClearGot()

func (*CaseResult) ClearInput

func (x *CaseResult) ClearInput()

func (*CaseResult) ClearWanted

func (x *CaseResult) ClearWanted()

func (*CaseResult) GetExpectedFailure

func (x *CaseResult) GetExpectedFailure() bool

func (*CaseResult) GetGot

func (x *CaseResult) GetGot() *TestResult

func (*CaseResult) GetInput

func (x *CaseResult) GetInput() *anypb.Any

func (*CaseResult) GetName

func (x *CaseResult) GetName() string

func (*CaseResult) GetSuccess

func (x *CaseResult) GetSuccess() bool

func (*CaseResult) GetWanted

func (x *CaseResult) GetWanted() *TestResult

func (*CaseResult) HasGot

func (x *CaseResult) HasGot() bool

func (*CaseResult) HasInput

func (x *CaseResult) HasInput() bool

func (*CaseResult) HasWanted

func (x *CaseResult) HasWanted() bool

func (*CaseResult) ProtoMessage

func (*CaseResult) ProtoMessage()

func (*CaseResult) ProtoReflect

func (x *CaseResult) ProtoReflect() protoreflect.Message

func (*CaseResult) Reset

func (x *CaseResult) Reset()

func (*CaseResult) SetExpectedFailure

func (x *CaseResult) SetExpectedFailure(v bool)

func (*CaseResult) SetGot

func (x *CaseResult) SetGot(v *TestResult)

func (*CaseResult) SetInput

func (x *CaseResult) SetInput(v *anypb.Any)

func (*CaseResult) SetName

func (x *CaseResult) SetName(v string)

func (*CaseResult) SetSuccess

func (x *CaseResult) SetSuccess(v bool)

func (*CaseResult) SetWanted

func (x *CaseResult) SetWanted(v *TestResult)

func (*CaseResult) String

func (x *CaseResult) String() string

type CaseResult_builder

type CaseResult_builder struct {

	// The case name.
	Name string
	// Success state of the test case. True if the test case succeeded.
	Success bool
	// The expected result.
	Wanted *TestResult
	// The actual result.
	Got *TestResult
	// The input used to invoke the test case.
	Input *anypb.Any
	// Denotes if the test is expected to fail. True, if the test case was expected to fail.
	ExpectedFailure bool
	// contains filtered or unexported fields
}

func (CaseResult_builder) Build

func (b0 CaseResult_builder) Build() *CaseResult

type ResultOptions

type ResultOptions struct {

	// The suite filter is a regex that matches against the suite name.
	SuiteFilter string `protobuf:"bytes,1,opt,name=suite_filter,json=suiteFilter,proto3" json:"suite_filter,omitempty"`
	// The case filter is a regex that matches against the case name.
	CaseFilter string `protobuf:"bytes,2,opt,name=case_filter,json=caseFilter,proto3" json:"case_filter,omitempty"`
	// If the test runner should print verbose output.
	Verbose bool `protobuf:"varint,3,opt,name=verbose,proto3" json:"verbose,omitempty"`
	// If the violation message must be an exact match.
	StrictMessage bool `protobuf:"varint,5,opt,name=strict_message,json=strictMessage,proto3" json:"strict_message,omitempty"`
	// If the distinction between runtime and compile time errors must be exact.
	StrictError bool `protobuf:"varint,6,opt,name=strict_error,json=strictError,proto3" json:"strict_error,omitempty"`
	// contains filtered or unexported fields
}

ResultOptions are the options passed to the test runner to configure the test run.

func (*ResultOptions) GetCaseFilter

func (x *ResultOptions) GetCaseFilter() string

func (*ResultOptions) GetStrictError

func (x *ResultOptions) GetStrictError() bool

func (*ResultOptions) GetStrictMessage

func (x *ResultOptions) GetStrictMessage() bool

func (*ResultOptions) GetSuiteFilter

func (x *ResultOptions) GetSuiteFilter() string

func (*ResultOptions) GetVerbose

func (x *ResultOptions) GetVerbose() bool

func (*ResultOptions) ProtoMessage

func (*ResultOptions) ProtoMessage()

func (*ResultOptions) ProtoReflect

func (x *ResultOptions) ProtoReflect() protoreflect.Message

func (*ResultOptions) Reset

func (x *ResultOptions) Reset()

func (*ResultOptions) SetCaseFilter

func (x *ResultOptions) SetCaseFilter(v string)

func (*ResultOptions) SetStrictError

func (x *ResultOptions) SetStrictError(v bool)

func (*ResultOptions) SetStrictMessage

func (x *ResultOptions) SetStrictMessage(v bool)

func (*ResultOptions) SetSuiteFilter

func (x *ResultOptions) SetSuiteFilter(v string)

func (*ResultOptions) SetVerbose

func (x *ResultOptions) SetVerbose(v bool)

func (*ResultOptions) String

func (x *ResultOptions) String() string

type ResultOptions_builder

type ResultOptions_builder struct {

	// The suite filter is a regex that matches against the suite name.
	SuiteFilter string
	// The case filter is a regex that matches against the case name.
	CaseFilter string
	// If the test runner should print verbose output.
	Verbose bool
	// If the violation message must be an exact match.
	StrictMessage bool
	// If the distinction between runtime and compile time errors must be exact.
	StrictError bool
	// contains filtered or unexported fields
}

func (ResultOptions_builder) Build

type ResultSet

type ResultSet struct {

	// Count of successes.
	Successes int32 `protobuf:"varint,1,opt,name=successes,proto3" json:"successes,omitempty"`
	// Count of failures.
	Failures int32 `protobuf:"varint,2,opt,name=failures,proto3" json:"failures,omitempty"`
	// List of suite results.
	Suites []*SuiteResults `protobuf:"bytes,3,rep,name=suites,proto3" json:"suites,omitempty"`
	// Options used to generate this result.
	Options *ResultOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"`
	// Count of expected failures.
	ExpectedFailures int32 `protobuf:"varint,5,opt,name=expected_failures,json=expectedFailures,proto3" json:"expected_failures,omitempty"`
	// contains filtered or unexported fields
}

A result is the result of a test run.

func (*ResultSet) ClearOptions

func (x *ResultSet) ClearOptions()

func (*ResultSet) GetExpectedFailures

func (x *ResultSet) GetExpectedFailures() int32

func (*ResultSet) GetFailures

func (x *ResultSet) GetFailures() int32

func (*ResultSet) GetOptions

func (x *ResultSet) GetOptions() *ResultOptions

func (*ResultSet) GetSuccesses

func (x *ResultSet) GetSuccesses() int32

func (*ResultSet) GetSuites

func (x *ResultSet) GetSuites() []*SuiteResults

func (*ResultSet) HasOptions

func (x *ResultSet) HasOptions() bool

func (*ResultSet) ProtoMessage

func (*ResultSet) ProtoMessage()

func (*ResultSet) ProtoReflect

func (x *ResultSet) ProtoReflect() protoreflect.Message

func (*ResultSet) Reset

func (x *ResultSet) Reset()

func (*ResultSet) SetExpectedFailures

func (x *ResultSet) SetExpectedFailures(v int32)

func (*ResultSet) SetFailures

func (x *ResultSet) SetFailures(v int32)

func (*ResultSet) SetOptions

func (x *ResultSet) SetOptions(v *ResultOptions)

func (*ResultSet) SetSuccesses

func (x *ResultSet) SetSuccesses(v int32)

func (*ResultSet) SetSuites

func (x *ResultSet) SetSuites(v []*SuiteResults)

func (*ResultSet) String

func (x *ResultSet) String() string

type ResultSet_builder

type ResultSet_builder struct {

	// Count of successes.
	Successes int32
	// Count of failures.
	Failures int32
	// List of suite results.
	Suites []*SuiteResults
	// Options used to generate this result.
	Options *ResultOptions
	// Count of expected failures.
	ExpectedFailures int32
	// contains filtered or unexported fields
}

func (ResultSet_builder) Build

func (b0 ResultSet_builder) Build() *ResultSet

type SuiteResults

type SuiteResults struct {

	// The suite name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Count of successes.
	Successes int32 `protobuf:"varint,2,opt,name=successes,proto3" json:"successes,omitempty"`
	// Count of failures.
	Failures int32 `protobuf:"varint,3,opt,name=failures,proto3" json:"failures,omitempty"`
	// List of case results.
	Cases []*CaseResult `protobuf:"bytes,4,rep,name=cases,proto3" json:"cases,omitempty"`
	// The file descriptor set used to generate this result.
	Fdset *descriptorpb.FileDescriptorSet `protobuf:"bytes,5,opt,name=fdset,proto3" json:"fdset,omitempty"`
	// Count of expected failures.
	ExpectedFailures int32 `protobuf:"varint,6,opt,name=expected_failures,json=expectedFailures,proto3" json:"expected_failures,omitempty"`
	// contains filtered or unexported fields
}

A suite result is a single test suite result.

func (*SuiteResults) ClearFdset

func (x *SuiteResults) ClearFdset()

func (*SuiteResults) GetCases

func (x *SuiteResults) GetCases() []*CaseResult

func (*SuiteResults) GetExpectedFailures

func (x *SuiteResults) GetExpectedFailures() int32

func (*SuiteResults) GetFailures

func (x *SuiteResults) GetFailures() int32

func (*SuiteResults) GetFdset

func (*SuiteResults) GetName

func (x *SuiteResults) GetName() string

func (*SuiteResults) GetSuccesses

func (x *SuiteResults) GetSuccesses() int32

func (*SuiteResults) HasFdset

func (x *SuiteResults) HasFdset() bool

func (*SuiteResults) ProtoMessage

func (*SuiteResults) ProtoMessage()

func (*SuiteResults) ProtoReflect

func (x *SuiteResults) ProtoReflect() protoreflect.Message

func (*SuiteResults) Reset

func (x *SuiteResults) Reset()

func (*SuiteResults) SetCases

func (x *SuiteResults) SetCases(v []*CaseResult)

func (*SuiteResults) SetExpectedFailures

func (x *SuiteResults) SetExpectedFailures(v int32)

func (*SuiteResults) SetFailures

func (x *SuiteResults) SetFailures(v int32)

func (*SuiteResults) SetFdset

func (*SuiteResults) SetName

func (x *SuiteResults) SetName(v string)

func (*SuiteResults) SetSuccesses

func (x *SuiteResults) SetSuccesses(v int32)

func (*SuiteResults) String

func (x *SuiteResults) String() string

type SuiteResults_builder

type SuiteResults_builder struct {

	// The suite name.
	Name string
	// Count of successes.
	Successes int32
	// Count of failures.
	Failures int32
	// List of case results.
	Cases []*CaseResult
	// The file descriptor set used to generate this result.
	Fdset *descriptorpb.FileDescriptorSet
	// Count of expected failures.
	ExpectedFailures int32
	// contains filtered or unexported fields
}

func (SuiteResults_builder) Build

func (b0 SuiteResults_builder) Build() *SuiteResults

type TestConformanceRequest

type TestConformanceRequest struct {
	Fdset *descriptorpb.FileDescriptorSet `protobuf:"bytes,2,opt,name=fdset,proto3" json:"fdset,omitempty"`
	Cases map[string]*anypb.Any           `` /* 137-byte string literal not displayed */
	// contains filtered or unexported fields
}

TestConformanceRequest is the request for Conformance Tests. The FileDescriptorSet is the FileDescriptorSet to test against. The cases map is a map of case name to the Any message that represents the case.

func (*TestConformanceRequest) ClearFdset

func (x *TestConformanceRequest) ClearFdset()

func (*TestConformanceRequest) GetCases

func (x *TestConformanceRequest) GetCases() map[string]*anypb.Any

func (*TestConformanceRequest) GetFdset

func (*TestConformanceRequest) HasFdset

func (x *TestConformanceRequest) HasFdset() bool

func (*TestConformanceRequest) ProtoMessage

func (*TestConformanceRequest) ProtoMessage()

func (*TestConformanceRequest) ProtoReflect

func (x *TestConformanceRequest) ProtoReflect() protoreflect.Message

func (*TestConformanceRequest) Reset

func (x *TestConformanceRequest) Reset()

func (*TestConformanceRequest) SetCases

func (x *TestConformanceRequest) SetCases(v map[string]*anypb.Any)

func (*TestConformanceRequest) SetFdset

func (*TestConformanceRequest) String

func (x *TestConformanceRequest) String() string

type TestConformanceRequest_builder

type TestConformanceRequest_builder struct {
	Fdset *descriptorpb.FileDescriptorSet
	Cases map[string]*anypb.Any
	// contains filtered or unexported fields
}

func (TestConformanceRequest_builder) Build

type TestConformanceResponse

type TestConformanceResponse struct {
	Results map[string]*TestResult `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

TestConformanceResponse is the response for Conformance Tests. The results map is a map of case name to the TestResult.

func (*TestConformanceResponse) GetResults

func (x *TestConformanceResponse) GetResults() map[string]*TestResult

func (*TestConformanceResponse) ProtoMessage

func (*TestConformanceResponse) ProtoMessage()

func (*TestConformanceResponse) ProtoReflect

func (x *TestConformanceResponse) ProtoReflect() protoreflect.Message

func (*TestConformanceResponse) Reset

func (x *TestConformanceResponse) Reset()

func (*TestConformanceResponse) SetResults

func (x *TestConformanceResponse) SetResults(v map[string]*TestResult)

func (*TestConformanceResponse) String

func (x *TestConformanceResponse) String() string

type TestConformanceResponse_builder

type TestConformanceResponse_builder struct {
	Results map[string]*TestResult
	// contains filtered or unexported fields
}

func (TestConformanceResponse_builder) Build

type TestResult

type TestResult struct {

	// Types that are valid to be assigned to Result:
	//
	//	*TestResult_Success
	//	*TestResult_ValidationError
	//	*TestResult_CompilationError
	//	*TestResult_RuntimeError
	//	*TestResult_UnexpectedError
	Result isTestResult_Result `protobuf_oneof:"result"`
	// contains filtered or unexported fields
}

TestResult is the result of a single test. Only one of the fields will be set.

func (*TestResult) ClearCompilationError

func (x *TestResult) ClearCompilationError()

func (*TestResult) ClearResult

func (x *TestResult) ClearResult()

func (*TestResult) ClearRuntimeError

func (x *TestResult) ClearRuntimeError()

func (*TestResult) ClearSuccess

func (x *TestResult) ClearSuccess()

func (*TestResult) ClearUnexpectedError

func (x *TestResult) ClearUnexpectedError()

func (*TestResult) ClearValidationError

func (x *TestResult) ClearValidationError()

func (*TestResult) GetCompilationError

func (x *TestResult) GetCompilationError() string

func (*TestResult) GetResult

func (x *TestResult) GetResult() isTestResult_Result

func (*TestResult) GetRuntimeError

func (x *TestResult) GetRuntimeError() string

func (*TestResult) GetSuccess

func (x *TestResult) GetSuccess() bool

func (*TestResult) GetUnexpectedError

func (x *TestResult) GetUnexpectedError() string

func (*TestResult) GetValidationError

func (x *TestResult) GetValidationError() *validate.Violations

func (*TestResult) HasCompilationError

func (x *TestResult) HasCompilationError() bool

func (*TestResult) HasResult

func (x *TestResult) HasResult() bool

func (*TestResult) HasRuntimeError

func (x *TestResult) HasRuntimeError() bool

func (*TestResult) HasSuccess

func (x *TestResult) HasSuccess() bool

func (*TestResult) HasUnexpectedError

func (x *TestResult) HasUnexpectedError() bool

func (*TestResult) HasValidationError

func (x *TestResult) HasValidationError() bool

func (*TestResult) ProtoMessage

func (*TestResult) ProtoMessage()

func (*TestResult) ProtoReflect

func (x *TestResult) ProtoReflect() protoreflect.Message

func (*TestResult) Reset

func (x *TestResult) Reset()

func (*TestResult) SetCompilationError

func (x *TestResult) SetCompilationError(v string)

func (*TestResult) SetRuntimeError

func (x *TestResult) SetRuntimeError(v string)

func (*TestResult) SetSuccess

func (x *TestResult) SetSuccess(v bool)

func (*TestResult) SetUnexpectedError

func (x *TestResult) SetUnexpectedError(v string)

func (*TestResult) SetValidationError

func (x *TestResult) SetValidationError(v *validate.Violations)

func (*TestResult) String

func (x *TestResult) String() string

func (*TestResult) WhichResult

func (x *TestResult) WhichResult() case_TestResult_Result

type TestResult_CompilationError

type TestResult_CompilationError struct {
	// compilation_error is the error if the test failed due to compilation errors.
	CompilationError string `protobuf:"bytes,3,opt,name=compilation_error,json=compilationError,proto3,oneof"`
}

type TestResult_RuntimeError

type TestResult_RuntimeError struct {
	// runtime_error is the error if the test failed due to runtime errors.
	RuntimeError string `protobuf:"bytes,4,opt,name=runtime_error,json=runtimeError,proto3,oneof"`
}

type TestResult_Success

type TestResult_Success struct {
	// success is true if the test succeeded.
	Success bool `protobuf:"varint,1,opt,name=success,proto3,oneof"`
}

type TestResult_UnexpectedError

type TestResult_UnexpectedError struct {
	// unexpected_error is any other error that may have occurred.
	UnexpectedError string `protobuf:"bytes,5,opt,name=unexpected_error,json=unexpectedError,proto3,oneof"`
}

type TestResult_ValidationError

type TestResult_ValidationError struct {
	// validation_error is the error if the test failed due to validation errors.
	ValidationError *validate.Violations `protobuf:"bytes,2,opt,name=validation_error,json=validationError,proto3,oneof"`
}

type TestResult_builder

type TestResult_builder struct {

	// Fields of oneof Result:
	// success is true if the test succeeded.
	Success *bool
	// validation_error is the error if the test failed due to validation errors.
	ValidationError *validate.Violations
	// compilation_error is the error if the test failed due to compilation errors.
	CompilationError *string
	// runtime_error is the error if the test failed due to runtime errors.
	RuntimeError *string
	// unexpected_error is any other error that may have occurred.
	UnexpectedError *string
	// contains filtered or unexported fields
}

func (TestResult_builder) Build

func (b0 TestResult_builder) Build() *TestResult

Source Files

  • harness.pb.go
  • results.pb.go

Jump to

Keyboard shortcuts

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