bugscpp.processor.test.SetupTestCommandScript

class SetupTestCommandScript(case: int)[source]

Bases: bugscpp.processor.test.TestCommandScript

Script to execute before running actual code.

It prepends an extra command which writes an index number to file addition to the given commands. It is script’s responsibility to read the file and parse into appropriate filter name. For instance, if the test is automake-generated, it might convert the number into ‘TESTS’ value. If the test is cmake-generated, it might convert the number into regex value of ‘–tests-regex’.

__init__(case: int)[source]

Methods

__init__(case)

after()

Invoked after script is executed.

before()

Invoked before script is executed.

output(linenr, exit_code, output)

Invoked after each line is executed.

should_be_run_at_once()

returns

Return true if it should be written to a file and executed at once,

step(linenr, line)

Invoked before each line is executed.

Attributes

OUTPUT_NAME

captured_output

case

after()

Invoked after script is executed.

before()[source]

Invoked before script is executed.

output(linenr: Optional[int], exit_code: int, output: str)

Invoked after each line is executed. linenr is None if all commands are executed as if it is a script.

Parameters
  • linenr (Optional[int]) – Index of the commands which has been executed. None if the type is CommandType.Script.

  • exit_code (Optional[int]) – Exit code of the executed command. None when stream is set to False.

  • output (str) – Captured stdout of the executed command.

should_be_run_at_once() bool
Returns

Return true if it should be written to a file and executed at once, otherwise if it is sent to a container line by line.

Return type

bool

step(linenr: int, line: str)

Invoked before each line is executed.

Parameters
  • linenr (int) – The current line number.

  • line (str) – The current line to execute.