Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case struct {
// Name of the testcase
Name string
// Values of gloal variables before run
Inputs map[string]interface{}
// Expected values of global vars after run
Outputs map[string]interface{}
// The same as Script.StopWhen. Both are merged together so this can be used to override/extend the script stop-conditions
StopWhen map[string]interface{}
}
Case defines inputs and expected outputs for a run
type CaseRunner ¶ added in v0.0.19
type CaseRunner struct {
Coordinator *vm.Coordinator
VMs []*vm.VM
VarTranslations []map[string]string
Case *Case
StopConditions map[string]*vm.Variable
}
CaseRunner represents a prepared test-case that is ready to run
func (CaseRunner) Run ¶ added in v0.0.19
func (cr CaseRunner) Run() []error
Run executes the case-runner
type Script ¶
type Script struct {
// The absolut path where the test-file was located. Used to retrieve the script files.
TestPath string
// Name of the script to run
Name string
// Content is the content of the script. If empty, it is loaded from disk at run-time
Content string
}
Script contains run-options for a script in the test
type Test ¶
type Test struct {
// The path where the test-file was located. Used to retrieve the script files.
Path string
// Scripts to use in this test
Scripts []Script
// Cases for this test
Cases []Case
// Maximum number of lines to run from the script (0=infinite)
MaxLines int
// Stop when is a map from global variable-name to value
// Execution is stopped when at least one of the listed variables is equal to the value
StopWhen map[string]interface{}
}
Test defines a test-run
func Parse ¶
Parse parses a yaml file into a Test path is the path from where the test was loaded. This is needed as the scripts are located relatice to the test-file
Click to show internal directories.
Click to hide internal directories.