diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
commit | 1903b037de2fb3e75826406b46f055acb70963fa (patch) | |
tree | 604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /packages/fcl-fpcunit/src/latextestreport.pp | |
parent | ad1141d52f8353457053b925cd674fe1d5c4eafc (diff) | |
parent | 953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff) | |
download | fpc-blocks.tar.gz |
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-fpcunit/src/latextestreport.pp')
-rw-r--r-- | packages/fcl-fpcunit/src/latextestreport.pp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/fcl-fpcunit/src/latextestreport.pp b/packages/fcl-fpcunit/src/latextestreport.pp index c690c62e1e..2f038c49a5 100644 --- a/packages/fcl-fpcunit/src/latextestreport.pp +++ b/packages/fcl-fpcunit/src/latextestreport.pp @@ -23,11 +23,14 @@ uses type + { TLatexResultsWriter } + TLatexResultsWriter = class(TCustomResultsWriter) private FDoc: TStringList; FSuiteHeaderIdx: TFPList; FTempFailure: TTestFailure; + function TimeFormat(ATiming: TDateTime): String; protected class function EscapeText(const S: string): String; virtual; procedure WriteTestHeader(ATest: TTest; ALevel: integer; ACount: integer); override; @@ -53,6 +56,21 @@ function GetSuiteAsLatex(aSuite: TTestSuite): string; implementation +uses dateutils; + +function TLatexResultsWriter.TimeFormat(ATiming: TDateTime): String; +Var + M : Int64; + +begin + Result:='ss.zzz'; + M:=MinutesBetween(ATiming,0); + if M>60 then + Result:='hh:mm:'+Result + else if M>1 then + Result:='mm:'+Result; +end; + class function TLatexResultsWriter.EscapeText(const S: string): String; var i: integer; @@ -161,7 +179,7 @@ begin inherited; S:=StringOfChar(' ',ALevel*2)+ ' '+ '\item[-] '; if Not SkipTiming then - S:=S+FormatDateTime('ss.zzz', ATiming); + S:=S+FormatDateTime(TimeFormat(ATiming), ATiming); S:=S+ ' ' + EscapeText(ATest.TestName); FDoc.Add(S); if Assigned(FTempFailure) then |