Running tests
Technical reference of Ejecución de pruebas.
This API is used in Execution.
Symbols
| Symbol | Class | Description |
|---|---|---|
| Executor | type | Executor defines a public type of API. |
| Mode | type | Mode defines a public type of API. |
| ModeTest | const | ModeTest defines a constant value of the API. |
| ModeBench | const | ModeBench defines a constant value of the API. |
| RuntimeContext | type | RuntimeContext defines a public type of API. |
| Messages | type | Messages defines a public type of API. |
| Failure | type | Failure defines a public type of API. |
| Failure.Error | func | Returns the textual representation of the error. |
| SetExecutor | func | Sets SetExecutor. |
| SetResultRecorder | func | Sets SetResultRecorder. |
| SetRuntimeContext | func | Sets SetRuntimeContext. |
| ClearRuntimeContext | func | Clean ClearRuntimeContext. |
| GetMode | func | Get it. GetMode. |
| IsBench | func | Indicates the state of IsBench. |
| CurrentMessages | func | Returns CurrentMessages. |
| Execute | func | Executed Execute. |
| noopExecutor.Execute | func | Executed Execute. |
| Save | func | The remaining changes remain. |
| Pass | func | It records a satisfactory result. |
| Fail | func | He records a failed result. |
| Explain | func | It records explanatory information. |
| Format | func | Formatea Format. |
| FormatBenchmark | func | Formatea FormatBenchmark. |
Executor
Declaration:
type Executor interface {
Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool)
} Executor defines a public type of API.
Mode
Declaration:
type Mode string Mode defines a public type of API.
ModeTest
Declaration:
ModeTest Mode = "test" ModeTest defines a constant value of the API.
ModeBench
Declaration:
ModeBench Mode = "bench" ModeBench defines a constant value of the API.
RuntimeContext
Declaration:
type RuntimeContext struct {
File string
Name string
Mode Mode
ResultRoot string
} RuntimeContext defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
File | string | Associated file. |
Name | string | Name of the value. |
Mode | Mode | Execution mode. |
ResultRoot | string | Result of operation. |
Messages
Declaration:
type Messages struct {
Pass []string
Fail []string
Explain []string
} Messages defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Pass | []string | Public data associated with Pass. |
Fail | []string | Public data associated with Fail. |
Explain | []string | Public data associated with Explain. |
Failure
Declaration:
type Failure struct {
Message string
} Failure defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Message | string | A descriptive message. |
Failure.Error
Declaration:
func (f Failure) Error() string Returns the textual representation of the error.
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := failure.Error() SetExecutor
Declaration:
func SetExecutor(value Executor) Sets SetExecutor.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | Executor | Value to be stored or issued. |
Usage syntax
test.SetExecutor(value) SetResultRecorder
Declaration:
func SetResultRecorder(value func(ExecuteResult)) Sets SetResultRecorder.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | func(ExecuteResult) | Value to be stored or issued. |
Usage syntax
test.SetResultRecorder(value) SetRuntimeContext
Declaration:
func SetRuntimeContext(value RuntimeContext) Sets SetRuntimeContext.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | RuntimeContext | Value to be stored or issued. |
ClearRuntimeContext
Declaration:
func ClearRuntimeContext() Clean ClearRuntimeContext.
Usage syntax
test.ClearRuntimeContext() GetMode
Declaration:
func GetMode() Mode Get it. GetMode.
Returns
| Return | Type | Description |
|---|---|---|
value | Mode | Type value Mode produced by the operation. |
Usage syntax
value := test.GetMode() IsBench
Declaration:
func IsBench() bool Indicates the state of IsBench.
Returns
| Return | Type | Description |
|---|---|---|
value | bool | It indicates the result of the check. |
Usage syntax
value := test.IsBench() CurrentMessages
Declaration:
func CurrentMessages() Messages Returns CurrentMessages.
Returns
| Return | Type | Description |
|---|---|---|
value | Messages | Type value Messages produced by the operation. |
Usage syntax
value := test.CurrentMessages() Execute
Declaration:
func Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool) Executed Execute.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Config | Type value Config required by the operation. |
pipeline | []ExecutePipeLine | Type value []ExecutePipeLine required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | ExecuteResult | Type value ExecuteResult produced by the operation. |
ok | bool | It indicates the result of the check. |
Usage syntax
value, ok := test.Execute(value, value) noopExecutor.Execute
Declaration:
func (noopExecutor) Execute(config Config, pipeline []ExecutePipeLine) (ExecuteResult, bool) Executed Execute.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Config | Type value Config required by the operation. |
pipeline | []ExecutePipeLine | Type value []ExecutePipeLine required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | ExecuteResult | Type value ExecuteResult produced by the operation. |
ok | bool | It indicates the result of the check. |
Usage syntax
value, ok := noopExecutor.Execute(value, value) Save
Declaration:
func Save(result ExecuteResult) The remaining changes remain.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | ExecuteResult | Type value ExecuteResult required by the operation. |
Usage syntax
test.Save(value) Pass
Declaration:
func Pass(message ...string) It records a satisfactory result.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | ...string | Type value ...string required by the operation. |
Usage syntax
test.Pass(value) Fail
Declaration:
func Fail(message ...string) He records a failed result.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | ...string | Type value ...string required by the operation. |
Usage syntax
test.Fail(value) Explain
Declaration:
func Explain(result ExecuteResult) It records explanatory information.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | ExecuteResult | Type value ExecuteResult required by the operation. |
Usage syntax
test.Explain(value) Format
Declaration:
func Format(result ExecuteResult) string Formatea Format.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | ExecuteResult | Type value ExecuteResult required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := test.Format(value) FormatBenchmark
Declaration:
func FormatBenchmark(result ExecuteResult) string Formatea FormatBenchmark.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | ExecuteResult | Type value ExecuteResult required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | string | Textual value produced by the operation; its zero value is an empty string. |
Usage syntax
value := test.FormatBenchmark(value)