mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 10:20:49 +01:00
fpcunit gui testrunner: cleanup
* use StartTime from TestResult * formatting: testResult -> TestResult git-svn-id: trunk@27873 -
This commit is contained in:
parent
89a235667f
commit
61d35b321a
@ -677,9 +677,7 @@ procedure TGUITestRunner.RunTest(ATest: TTest);
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
testResult:TTestResult;
|
TestResult:TTestResult;
|
||||||
FStopCrono: TDateTime;
|
|
||||||
FStartCrono: TDateTime;
|
|
||||||
w: TXMLResultsWriter;
|
w: TXMLResultsWriter;
|
||||||
m: TMemoryStream;
|
m: TMemoryStream;
|
||||||
|
|
||||||
@ -691,25 +689,22 @@ begin
|
|||||||
testsCounter := 0;
|
testsCounter := 0;
|
||||||
skipsCounter := 0;
|
skipsCounter := 0;
|
||||||
EnableRunActions(false);
|
EnableRunActions(false);
|
||||||
testResult := TTestResult.Create;
|
TestResult := TTestResult.Create;
|
||||||
try
|
try
|
||||||
SkipUncheckedTests(testResult, TestTree.Selected);
|
SkipUncheckedTests(TestResult, TestTree.Selected);
|
||||||
skipsCounter := testResult.NumberOfSkippedTests;
|
skipsCounter := TestResult.NumberOfSkippedTests;
|
||||||
testResult.AddListener(self);
|
TestResult.AddListener(self);
|
||||||
pbBar.Invalidate;
|
pbBar.Invalidate;
|
||||||
w := TXMLResultsWriter.Create(nil);
|
w := TXMLResultsWriter.Create(nil);
|
||||||
w.FileName := 'null'; // prevents output to the console
|
w.FileName := 'null'; // prevents output to the console
|
||||||
testResult.AddListener(w);
|
TestResult.AddListener(w);
|
||||||
|
|
||||||
MemoLog(Format(rsRunning, [TestTree.Selected.Text]));
|
MemoLog(Format(rsRunning, [TestTree.Selected.Text]));
|
||||||
FStartCrono := Now;
|
aTest.Run(TestResult);
|
||||||
aTest.Run(testResult);
|
MemoLog(Format(rsNumberOfExec, [IntToStr(TestResult.RunTests),
|
||||||
FStopCrono := Now;
|
FormatDateTime('hh:nn:ss.zzz', Now - TestResult.StartingTime)]));
|
||||||
// In the next fpc (post 2.0.4) we can pull the time from the TestResult
|
|
||||||
MemoLog(Format(rsNumberOfExec, [IntToStr(testResult.RunTests),
|
|
||||||
FormatDateTime('hh:nn:ss.zzz', FStopCrono - FStartCrono)]));
|
|
||||||
|
|
||||||
w.WriteResult(testResult);
|
w.WriteResult(TestResult);
|
||||||
m := TMemoryStream.Create;
|
m := TMemoryStream.Create;
|
||||||
WriteXMLFile(w.Document, m);
|
WriteXMLFile(w.Document, m);
|
||||||
m.Position := 0;
|
m.Position := 0;
|
||||||
@ -721,7 +716,7 @@ begin
|
|||||||
|
|
||||||
m.free;
|
m.free;
|
||||||
w.Free;
|
w.Free;
|
||||||
testResult.Free;
|
TestResult.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user