fpcunit: guitestrunner: handle xml errors

git-svn-id: trunk@40832 -
This commit is contained in:
mattias 2013-04-17 08:01:05 +00:00
parent 2ef3cf5a5c
commit 88212d1ab2
2 changed files with 43 additions and 25 deletions

View File

@ -83,7 +83,7 @@ object GUITestRunner: TGUITestRunner
Left = 7 Left = 7
Height = 34 Height = 34
Top = 7 Top = 7
Width = 78 Width = 80
Action = RunAction Action = RunAction
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -172,10 +172,10 @@ object GUITestRunner: TGUITestRunner
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 489 Left = 486
Height = 34 Height = 34
Top = 7 Top = 7
Width = 79 Width = 82
Action = ActCloseForm Action = ActCloseForm
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
@ -266,10 +266,10 @@ object GUITestRunner: TGUITestRunner
AnchorSideLeft.Control = BtnRun AnchorSideLeft.Control = BtnRun
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1 AnchorSideTop.Control = Panel1
Left = 91 Left = 93
Height = 32 Height = 32
Top = 7 Top = 7
Width = 147 Width = 158
Action = ActRunHighlightedTest Action = ActRunHighlightedTest
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -367,27 +367,27 @@ object GUITestRunner: TGUITestRunner
TabOrder = 0 TabOrder = 0
object tsTestTree: TTabSheet object tsTestTree: TTabSheet
Caption = 'Testcase tree' Caption = 'Testcase tree'
ClientHeight = 474 ClientHeight = 472
ClientWidth = 565 ClientWidth = 565
object Splitter1: TSplitter object Splitter1: TSplitter
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 5 Height = 5
Top = 336 Top = 334
Width = 565 Width = 565
Align = alBottom Align = alBottom
ResizeAnchor = akBottom ResizeAnchor = akBottom
end end
object TestTree: TTreeView object TestTree: TTreeView
Left = 6 Left = 6
Height = 324 Height = 322
Top = 6 Top = 6
Width = 553 Width = 553
Align = alClient Align = alClient
BorderSpacing.Around = 6 BorderSpacing.Around = 6
BackgroundColor = clBtnFace BackgroundColor = clBtnFace
Color = clBtnFace Color = clBtnFace
DefaultItemHeight = 16 DefaultItemHeight = 18
Images = TestTreeImageList Images = TestTreeImageList
PopupMenu = PopupMenu3 PopupMenu = PopupMenu3
ReadOnly = True ReadOnly = True
@ -403,7 +403,7 @@ object GUITestRunner: TGUITestRunner
object Memo1: TMemo object Memo1: TMemo
Left = 6 Left = 6
Height = 121 Height = 121
Top = 347 Top = 345
Width = 553 Width = 553
Align = alBottom Align = alBottom
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -850,6 +850,12 @@ object GUITestRunner: TGUITestRunner
end> end>
VisibleSpecialChars = [vscSpace, vscTabAtLast] VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True ReadOnly = True
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
SelectedColor.BoldPriority = 50
SelectedColor.ItalicPriority = 50
SelectedColor.UnderlinePriority = 50
BracketHighlightStyle = sbhsBoth BracketHighlightStyle = sbhsBoth
BracketMatchColor.Background = clNone BracketMatchColor.Background = clNone
BracketMatchColor.Foreground = clNone BracketMatchColor.Foreground = clNone
@ -885,6 +891,8 @@ object GUITestRunner: TGUITestRunner
object TSynGutterSeparator object TSynGutterSeparator
Width = 2 Width = 2
MouseActions = <> MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end end
object TSynGutterCodeFolding object TSynGutterCodeFolding
MouseActions = < MouseActions = <

View File

@ -724,26 +724,36 @@ begin
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 try
TestResult.AddListener(w); w.FileName := 'null'; // prevents output to the console
TestResult.AddListener(w);
MemoLog(Format(rsRunning, [TestTree.Selected.Text])); MemoLog(Format(rsRunning, [TestTree.Selected.Text]));
aTest.Run(TestResult); aTest.Run(TestResult);
MemoLog(Format(rsNumberOfExec, [IntToStr(TestResult.RunTests), MemoLog(Format(rsNumberOfExec, [IntToStr(TestResult.RunTests),
FormatDateTime('hh:nn:ss.zzz', Now - TestResult.StartingTime)])); FormatDateTime('hh:nn:ss.zzz', Now - TestResult.StartingTime)]));
w.WriteResult(TestResult); w.WriteResult(TestResult);
m := TMemoryStream.Create; m := TMemoryStream.Create;
WriteXMLFile(w.Document, m); try
m.Position := 0; try
XMLSynEdit.Lines.LoadFromStream(m); WriteXMLFile(w.Document, m);
m.Position := 0;
pbBar.Invalidate; XMLSynEdit.Lines.LoadFromStream(m);
except
on E: Exception do
XMLSynEdit.Lines.Text:='WriteXMLFile exception: '+E.ClassName+'/'+E.Message;
end;
finally
m.Free;
end;
pbBar.Invalidate;
finally
w.Free;
end;
finally finally
EnableRunActions(true); EnableRunActions(true);
m.free;
w.Free;
TestResult.Free; TestResult.Free;
end; end;
end; end;