Running tests

Technical reference of Ejecución de pruebas.

This API is used in Execution.


Symbols

SymbolClassDescription
ExecutortypeExecutor defines a public type of API.
ModetypeMode defines a public type of API.
ModeTestconstModeTest defines a constant value of the API.
ModeBenchconstModeBench defines a constant value of the API.
RuntimeContexttypeRuntimeContext defines a public type of API.
MessagestypeMessages defines a public type of API.
FailuretypeFailure defines a public type of API.
Failure.ErrorfuncReturns the textual representation of the error.
SetExecutorfuncSets SetExecutor.
SetResultRecorderfuncSets SetResultRecorder.
SetRuntimeContextfuncSets SetRuntimeContext.
ClearRuntimeContextfuncClean ClearRuntimeContext.
GetModefuncGet it. GetMode.
IsBenchfuncIndicates the state of IsBench.
CurrentMessagesfuncReturns CurrentMessages.
ExecutefuncExecuted Execute.
noopExecutor.ExecutefuncExecuted Execute.
SavefuncThe remaining changes remain.
PassfuncIt records a satisfactory result.
FailfuncHe records a failed result.
ExplainfuncIt records explanatory information.
FormatfuncFormatea Format.
FormatBenchmarkfuncFormatea FormatBenchmark.

Executor

Declaration:

gox
type Executor interface {
	Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool)
}

Executor defines a public type of API.


Mode

Declaration:

gox
type Mode string

Mode defines a public type of API.


ModeTest

Declaration:

gox
ModeTest  Mode = "test"

ModeTest defines a constant value of the API.


ModeBench

Declaration:

gox
ModeBench Mode = "bench"

ModeBench defines a constant value of the API.


RuntimeContext

Declaration:

gox
type RuntimeContext struct {
	File       string
	Name       string
	Mode       Mode
	ResultRoot string
}

RuntimeContext defines a public type of API.

Fields

FieldTypeDescription
FilestringAssociated file.
NamestringName of the value.
ModeModeExecution mode.
ResultRootstringResult of operation.

Messages

Declaration:

gox
type Messages struct {
	Pass    []string
	Fail    []string
	Explain []string
}

Messages defines a public type of API.

Fields

FieldTypeDescription
Pass[]stringPublic data associated with Pass.
Fail[]stringPublic data associated with Fail.
Explain[]stringPublic data associated with Explain.

Failure

Declaration:

gox
type Failure struct {
	Message string
}

Failure defines a public type of API.

Fields

FieldTypeDescription
MessagestringA descriptive message.

Failure.Error

Declaration:

gox
func (f Failure) Error() string

Returns the textual representation of the error.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := failure.Error()

SetExecutor

Declaration:

gox
func SetExecutor(value Executor)

Sets SetExecutor.

Parameters

ParameterTypeDescription
valueExecutorValue to be stored or issued.

Usage syntax

gox
test.SetExecutor(value)

SetResultRecorder

Declaration:

gox
func SetResultRecorder(value func(ExecuteResult))

Sets SetResultRecorder.

Parameters

ParameterTypeDescription
valuefunc(ExecuteResult)Value to be stored or issued.

Usage syntax

gox
test.SetResultRecorder(value)

SetRuntimeContext

Declaration:

gox
func SetRuntimeContext(value RuntimeContext)

Sets SetRuntimeContext.

Parameters

ParameterTypeDescription
valueRuntimeContextValue to be stored or issued.

ClearRuntimeContext

Declaration:

gox
func ClearRuntimeContext()

Clean ClearRuntimeContext.

Usage syntax

gox
test.ClearRuntimeContext()

GetMode

Declaration:

gox
func GetMode() Mode

Get it. GetMode.

Returns

ReturnTypeDescription
valueModeType value Mode produced by the operation.

Usage syntax

gox
value := test.GetMode()

IsBench

Declaration:

gox
func IsBench() bool

Indicates the state of IsBench.

Returns

ReturnTypeDescription
valueboolIt indicates the result of the check.

Usage syntax

gox
value := test.IsBench()

CurrentMessages

Declaration:

gox
func CurrentMessages() Messages

Returns CurrentMessages.

Returns

ReturnTypeDescription
valueMessagesType value Messages produced by the operation.

Usage syntax

gox
value := test.CurrentMessages()

Execute

Declaration:

gox
func Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool)

Executed Execute.

Parameters

ParameterTypeDescription
configConfigType value Config required by the operation.
pipeline[]ExecutePipeLineType value []ExecutePipeLine required by the operation.

Returns

ReturnTypeDescription
valueExecuteResultType value ExecuteResult produced by the operation.
okboolIt indicates the result of the check.

Usage syntax

gox
value, ok := test.Execute(value, value)

noopExecutor.Execute

Declaration:

gox
func (noopExecutor) Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool)

Executed Execute.

Parameters

ParameterTypeDescription
configConfigType value Config required by the operation.
pipeline[]ExecutePipeLineType value []ExecutePipeLine required by the operation.

Returns

ReturnTypeDescription
valueExecuteResultType value ExecuteResult produced by the operation.
okboolIt indicates the result of the check.

Usage syntax

gox
value, ok := noopExecutor.Execute(value, value)

Save

Declaration:

gox
func Save(result ExecuteResult)

The remaining changes remain.

Parameters

ParameterTypeDescription
resultExecuteResultType value ExecuteResult required by the operation.

Usage syntax

gox
test.Save(value)

Pass

Declaration:

gox
func Pass(message ...string)

It records a satisfactory result.

Parameters

ParameterTypeDescription
message...stringType value ...string required by the operation.

Usage syntax

gox
test.Pass(value)

Fail

Declaration:

gox
func Fail(message ...string)

He records a failed result.

Parameters

ParameterTypeDescription
message...stringType value ...string required by the operation.

Usage syntax

gox
test.Fail(value)

Explain

Declaration:

gox
func Explain(result ExecuteResult)

It records explanatory information.

Parameters

ParameterTypeDescription
resultExecuteResultType value ExecuteResult required by the operation.

Usage syntax

gox
test.Explain(value)

Format

Declaration:

gox
func Format(result ExecuteResult) string

Formatea Format.

Parameters

ParameterTypeDescription
resultExecuteResultType value ExecuteResult required by the operation.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := test.Format(value)

FormatBenchmark

Declaration:

gox
func FormatBenchmark(result ExecuteResult) string

Formatea FormatBenchmark.

Parameters

ParameterTypeDescription
resultExecuteResultType value ExecuteResult required by the operation.

Returns

ReturnTypeDescription
valuestringTextual value produced by the operation; its zero value is an empty string.

Usage syntax

gox
value := test.FormatBenchmark(value)

See also

Next step

Continue with results structures.

Test results