Hi,
Attached is a patch which will show test timing results in the xml
output. The timing will only be visible if the latest fpc 2.1.1 (with
todays fpcunit patch) is used. It FPC 2.0.4 is used, no timing
results will be shown.
Patch needs to be applied from the root Lazarus directory.
Regards,
- Graeme -
--
There's no place like 127.0.0.1
Index: components/fpcunit/guitestrunner.pas
===================================================================
--- components/fpcunit/guitestrunner.pas (revision 9941)
+++ components/fpcunit/guitestrunner.pas (working copy)
@@ -181,22 +181,27 @@
testResult := TTestResult.Create;
try
testResult.AddListener(self);
+ {$IFNDEF UseOldXML}
+ w := TXMLResultsWriter.Create;
+ TestResult.AddListener(w);
+ {$ENDIF}
MemoLog('Running ' + TestTree.Selected.Text);
FStartCrono := Now;
testSuite.Run(testResult);
FStopCrono := Now;
- MemoLog('Number of executed tests: ' + IntToStr(testResult.RunTests) + ' Time elapsed: ' +
- FormatDateTime('hh:nn:ss.zzz', FStopCrono - FStartCrono));
+ // In the next fpc (post 2.0.4) we can pull the time from the TestResult
+ MemoLog('Number of executed tests: ' + IntToStr(testResult.RunTests)
+ + ' Time elapsed: '
+ + FormatDateTime('hh:nn:ss.zzz', FStopCrono - FStartCrono));
{$IFNDEF UseOldXML}
- w := TXMLResultsWriter.Create;
w.WriteResult(testResult);
m := TMemoryStream.Create;
WriteXMLFile(w.Document, m);
m.Position := 0;
XMLSynEdit.Lines.LoadFromStream(m);
{$ELSE}
- XMLSynEdit.lines.text:= '<TestResults>' + system.sLineBreak +
+ XMLSynEdit.lines.text := '<TestResults>' + system.sLineBreak +
TestResultAsXML(testResult) + system.sLineBreak + '</TestResults>';
{$ENDIF}