Class TTestReport
Unit
Declaration
type TTestReport = class(TObject)
Description
<sumary> This class aims to interpret the fpcunit test xml file and produce a simpler report summarizing all tests cases and also providing their location on source code. )
Hierarchy
- TObject
- TTestReport
Overview
Methods
constructor Create; |
|
destructor Destroy; override; |
|
class function New(ABuider: ICommandBuilder; const AProjectSource: string): TTestReport; |
|
function ParseXmlTestsFile(const ATestApp, AFileName: string): TTestReport; |
|
function AddItem(AItem: TTestCaseItem): TTestCaseItem; |
|
procedure Output; |
Properties
property Executable: string read FExecutable write FExecutable; |
|
property ProjectSource: string read FProjectSource write FProjectSource; |
|
property TestCaseCount: Integer read FTestCaseCount write FTestCaseCount; |
|
property TestSuiteCount: Integer read FTestSuiteCount write FTestSuiteCount; |
|
property TotalTime: string read FTotalTime write FTotalTime; |
|
property TestsPassed: Integer read FTestsPassed write FTestsPassed; |
|
property TestsFailed: Integer read FTestsFailed write FTestsFailed; |
|
property TestCaseData: TArray<TTestCaseItem> read FTestCaseData write FTestCaseData; |
Description
Methods
constructor Create; |
|
Class constructor that initializes array that hold test case data. Check factory method new as the best option. |
destructor Destroy; override; |
|
The class's destructor frees all TTestCaseItem instances created during parse. |
class function New(ABuider: ICommandBuilder; const AProjectSource: string): TTestReport; |
|
It is the best way to create a new instance of the class, as it considers its dependencies.
A valid instance of ICommandBuilder. Basically it will be used to generate the output to the console considering the theme settings.) The path to the source code, needed to find the files corresponding to the source code reported in the fpcunit xml test file. ) |
function ParseXmlTestsFile(const ATestApp, AFileName: string): TTestReport; |
|
Parses the contents of the test xml file generated by the fpunit tests frameworkk. Groups the information into a TTestCaseItem list. It summarizes the total of tests, tests that passed, tests that failed in addition to searching for the location of the tests that failed in the source code.
Parameters
|
function AddItem(AItem: TTestCaseItem): TTestCaseItem; |
|
Adds a new TestCaseItem to TestCaseData, internally used by ParseXmlTestsFile.
Parameters
|
Properties
property Executable: string read FExecutable write FExecutable; |
|
Test project excutable name. |
property ProjectSource: string read FProjectSource write FProjectSource; |
|
Path to test project source files |
property TestCaseCount: Integer read FTestCaseCount write FTestCaseCount; |
|
Total test cases found on xml test file after parse |
property TestSuiteCount: Integer read FTestSuiteCount write FTestSuiteCount; |
|
Total test suites found on xml test file after parse |
property TotalTime: string read FTotalTime write FTotalTime; |
|
Total test elapsed time found on xml test file after parse |
property TestsPassed: Integer read FTestsPassed write FTestsPassed; |
|
Total test that passed found on xml test file after parse |
property TestsFailed: Integer read FTestsFailed write FTestsFailed; |
|
Total test that passed found on xml test file after parse |
property TestCaseData: TArray<TTestCaseItem> read FTestCaseData write FTestCaseData; |
|
All test case found on xml test file after parse |
Generated by PasDoc 0.16.0.