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 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 []string
// ScriptContents contains the contents of the scripts in .Scripts, Used mainly for testing
ScriptContents []string
// 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 relative to the test-file
func (Test) GetRunner ¶ added in v0.0.19
func (t Test) GetRunner(casenr int) (runner *CaseRunner, err error)
GetRunner creates an executable TestRunner for the given testcase
func (Test) GetScriptCode ¶ added in v0.0.20
GetScriptCode returns the code for indexed script.
Click to show internal directories.
Click to hide internal directories.