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{} // Maximum amount of lines to run for this case MaxLines int }
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 Test *Test Case *Case StopConditions map[string]*vm.Variable // If true, the VMs are already running, but currently paused Paused bool // This channel will be closed once the test-case has been executed Done chan struct{} }
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{} // When true, ignore runtime errors during testing IgnoreErrs bool // The chip-type to use for execution ChipType string // Run tests on after another and keep the state between cases Sequential bool // contains filtered or unexported fields }
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.