Package qm :: Package test :: Module report :: Class ReportGenerator
[hide private]
[frames] | no frames]

Class ReportGenerator

source code

A 'ReportGenerator' generates a test report from one or more result files.

Instance Methods [hide private]
 
__init__(self, output, database=None) source code
 
GenerateReport(self, flat, arguments)
Generates a report file with results collected from a set of result files.
source code
 
_LoadTestRuns(self, input)
Load test runs from the provided input.
source code
 
_GetIds(self, test_runs)
Return a list of ids to report results from.
source code
 
_ReportFlat(self, test_runs)
Generate test report with the given set of test runs.
source code
 
_Report(self, test_runs)
Generate test report with the given set of test runs.
source code
 
_ReportSubdirectory(self, directory, test_runs, element=None)
Generate a DOM node for the given directory containing its results.
source code
 
_ReportItem(self, kind, item_id, name, test_runs, parent)
Report a single item.
source code
Method Details [hide private]

GenerateReport(self, flat, arguments)

source code 

Generates a report file with results collected from a set of result files.

'flat' -- True to indicate a flat result listing, False if tests should be reported according to the database directory structure.

'arguments' -- command arguments of the form [result [-e expectation]]+

returns -- None.

_LoadTestRuns(self, input)

source code 

Load test runs from the provided input.

'input' -- A list of pairs of file names referring to result files / expectation files. The expectation file member may be None.

returns -- A list of pairs of TestRun objects.

_GetIds(self, test_runs)

source code 

Return a list of ids to report results from. This list is obtained from the database if it is present, or else by taking the union of all items reported in the test runs.

'test_runs' -- A list of result / expectation table pairs.

returns -- The tuple of resource-setup-ids, test-ids, and resource-cleanup-ids.

_ReportFlat(self, test_runs)

source code 

Generate test report with the given set of test runs. The report will contain a flat list of item ids.

'test_runs' -- List of pairs of TestRun objects.

_Report(self, test_runs)

source code 

Generate test report with the given set of test runs. The report will contain a tree structure with items appearing in their respective subdirectory.

'test_runs' -- List of pairs of TestRun objects.

_ReportSubdirectory(self, directory, test_runs, element=None)

source code 

Generate a DOM node for the given directory containing its results.

'directory' -- The directory for which to generate the report node.

'test_runs' -- The List of TestRuns.

'element' -- DOM element to store results into. If this is None, an element will be created.

returns -- DOM element node containing the xmlified results.

_ReportItem(self, kind, item_id, name, test_runs, parent)

source code 

Report a single item.

'kind' -- The kind of item to report.

'item_id' -- The item id to report.

'name' -- The item's name (usually either the absolute or relative id).

'test_runs' -- The list of test runs.

'parent' -- An XML element to insert new nodes into.