* SkipTiming by Reinier

git-svn-id: trunk@24170 -
This commit is contained in:
michael 2013-04-07 08:24:22 +00:00
parent b1993beb9f
commit 6c0d61f879
2 changed files with 27 additions and 16 deletions

View File

@ -18,10 +18,10 @@
Purpose:
This unit contains a XML TestListener for use with the fpcUnit testing
framework. It uses the XMLWrite unit, which is part of FPC, to generate
the XML document. The benefit of using the XMLWrite unit, is that the
data generated is valid XML, with resevered characters correctly escaped.
This unit contains an XML TestListener for use with the fpcUnit testing
framework. It uses the XMLWrite unit, which is part of FPC, to generate
the XML document. The benefit of using the XMLWrite unit is that the
data generated is valid XML, with reserved characters correctly escaped.
This allows the XML document to be further processed with XSLT etc without
any issues.
@ -107,9 +107,12 @@ begin
n.AppendChild(FDoc.CreateTextNode(IntToStr(pTestResult.NumberOfIgnoredTests)));
lResults.AppendChild(n);
n := FDoc.CreateElement('TotalElapsedTime');
n.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz', Now - pTestResult.StartingTime)));
lResults.AppendChild(n);
if not(SkipTiming) then
begin
n := FDoc.CreateElement('TotalElapsedTime');
n.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz', Now - pTestResult.StartingTime)));
lResults.AppendChild(n);
end;
{ Summary of ISO 8601 http://www.cl.cam.ac.uk/~mgk25/iso-time.html }
n := FDoc.CreateElement('DateTimeRan');
@ -244,9 +247,12 @@ var
lNew: TDOMElement;
begin
n := FLastTestSuite.LastChild;
lNew := FDoc.CreateElement('ElapsedTime');
lNew.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz', Now - FStartCrono)));
n.AppendChild(lNew);
if not(SkipTiming) then
begin
lNew := FDoc.CreateElement('ElapsedTime');
lNew.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz', Now - FStartCrono)));
n.AppendChild(lNew);
end;
end;
procedure TXMLResultsWriter.StartTestSuite(ATestSuite: TTestSuite);

View File

@ -129,7 +129,8 @@ end;
procedure TXMLResultsWriter.WriteTestFooter(ATest: TTest; ALevel: integer; ATiming: TDateTime);
begin
inherited;
FCurrentTest['ElapsedTime'] := FormatDateTime('hh:nn:ss.zzz', ATiming);
if not SkipTiming then
FCurrentTest['ElapsedTime'] := FormatDateTime('hh:nn:ss.zzz', ATiming);
end;
@ -156,7 +157,8 @@ var
begin
inherited;
n := TDomElement(FSuitePath[FSuitePath.Count -1]);
n['ElapsedTime'] := FormatDateTime('hh:nn:ss.zzz', ATiming);
if not SkipTiming then
n['ElapsedTime'] := FormatDateTime('hh:nn:ss.zzz', ATiming);
n['NumberOfRunTests'] := IntToStr(ANumRuns);
n['NumberOfErrors'] := IntToStr(ANumErrors);
n['NumberOfFailures'] := IntToStr(ANumFailures);
@ -267,10 +269,13 @@ begin
n.AppendChild(FDoc.CreateTextNode(IntToStr(aResult.NumberOfIgnoredTests)));
lResults.AppendChild(n);
n := FDoc.CreateElement('TotalElapsedTime');
n.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz',
Now - aResult.StartingTime)));
lResults.AppendChild(n);
if not SkipTiming then
begin
n := FDoc.CreateElement('TotalElapsedTime');
n.AppendChild(FDoc.CreateTextNode(FormatDateTime('hh:nn:ss.zzz',
Now - aResult.StartingTime)));
lResults.AppendChild(n);
end;
{ Summary of ISO 8601 http://www.cl.cam.ac.uk/~mgk25/iso-time.html }
n := FDoc.CreateElement('DateTimeRan');