pyggi.test_result module

This module contains TestResult class.

class pyggi.test_result.TestResult(compiled, custom=None, elapsed_time=None)[source]

Bases: object

TestResult stores the result of the test suite executions on the original or patched source code. It records whether compilation succeeded, the elapsed execution time, as well as any other user-defined test results.

get(name: str)[source]
Parameters:name (str) – The a name of the custom result
Returns:The value of the custom result
Return type:str
classmethod pyggi_result_parser(stdout: str, stderr: str)[source]

The test script should print results in the predefined, PYGGI-recognisable format. This method parses the results.

Parameters:stdout (str) – The stdout of the test script
Returns:The TestResult instance. If the PYGGI output are not detected, it is regarded as compile(execution) failure.
Return type:TestResult

Note

When the stdout is

[PYGGI_RESULT] {runtime: 7,pass_all: true}

, returns TestResult(True, {'runtime': 7, 'pass_all': 'true'})