74
74
ToggleButton buttonSuccess;
75
75
ToggleButton buttonFailures;
76
76
ToggleButton buttonIgnored;
77
ToggleButton buttonInconclusive;
77
78
ToggleButton buttonOutput;
125
127
var sw = new MonoDevelop.Components.CompactScrolledWindow ();
126
128
sw.ShadowType = ShadowType.None;
127
sw.Add(failuresTreeView);
129
sw.Add (failuresTreeView);
128
130
book.Pack1 (sw, true, true);
130
outputView = new TextView();
132
outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView ();
131
133
outputView.Editable = false;
132
134
bold = new TextTag ("bold");
133
135
bold.Weight = Pango.Weight.Bold;
134
136
outputView.Buffer.TagTable.Add (bold);
135
137
sw = new MonoDevelop.Components.CompactScrolledWindow ();
136
138
sw.ShadowType = ShadowType.None;
138
140
book.Pack2 (sw, true, true);
139
141
outputViewScrolled = sw;
164
166
buttonSuccess.Toggled += new EventHandler (OnShowSuccessfulToggled);
165
167
buttonSuccess.TooltipText = GettextCatalog.GetString ("Show Successful Tests");
166
168
toolbar.Add (buttonSuccess);
170
buttonInconclusive = new ToggleButton ();
171
buttonInconclusive.Label = GettextCatalog.GetString ("Inconclusive Tests");
172
buttonInconclusive.Active = true;
173
buttonInconclusive.Image = new Gtk.Image (CircleImage.Inconclusive);
174
buttonInconclusive.Image.Show ();
175
buttonInconclusive.Toggled += new EventHandler (OnShowInconclusiveToggled);
176
buttonInconclusive.TooltipText = GettextCatalog.GetString ("Show Inconclusive Tests");
177
toolbar.Add (buttonInconclusive);
168
179
buttonFailures = new ToggleButton ();
169
180
buttonFailures.Label = GettextCatalog.GetString ("Failed Tests");
173
184
buttonFailures.Toggled += new EventHandler (OnShowFailuresToggled);
174
185
buttonFailures.TooltipText = GettextCatalog.GetString ("Show Failed Tests");
175
186
toolbar.Add (buttonFailures);
177
188
buttonIgnored = new ToggleButton ();
178
189
buttonIgnored.Label = GettextCatalog.GetString ("Ignored Tests");
179
190
buttonIgnored.Active = true;
315
329
buttonStop.Sensitive = true;
316
330
buttonRun.Sensitive = false;
332
if (failuresTreeView.IsRealized)
333
failuresTreeView.ScrollToPoint (0, 0);
318
335
failuresStore.Clear ();
319
336
outputView.Buffer.Clear ();
587
612
failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
588
613
failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
615
if (result.IsInconclusive) {
616
if (!buttonInconclusive.Active)
618
TreeIter testRow = failuresStore.AppendValues (CircleImage.Inconclusive, Escape (test.FullName), test);
619
if (result.Message != null)
620
failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
621
failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
591
624
string msg = GettextCatalog.GetString ("Running {0} ...", test.FullName);
592
625
TextIter it = outputView.Buffer.EndIter;
656
689
public event TestHandler CancelRequested;
659
class TestMonitor: GuiSyncObject, ITestProgressMonitor
692
class TestMonitor: ITestProgressMonitor
661
// TestResultsPad can't be a GuiSyncObject because there are some
662
// object identity issues. If the pad is registered using the
663
// proxy, it will get different hash codes depending on the caller.
665
694
ITestProgressMonitor monitor;
666
695
TestResultsPad pad;
668
public TestMonitor (TestResultsPad pad) {
697
public TestMonitor (TestResultsPad pad)
670
700
this.monitor = pad;
672
public void InitializeTestRun (UnitTest test) {
673
pad.InitializeTestRun (test);
675
public void FinishTestRun () {
676
pad.FinishTestRun ();
678
public void Cancel () {
681
public void BeginTest (UnitTest test) {
682
monitor.BeginTest (test);
684
public void EndTest (UnitTest test, UnitTestResult result) {
685
monitor.EndTest (test, result);
687
public void ReportRuntimeError (string message, Exception exception) {
688
monitor.ReportRuntimeError (message, exception);
702
public void InitializeTestRun (UnitTest test)
704
DispatchService.GuiDispatch (delegate {
705
pad.InitializeTestRun (test);
708
public void FinishTestRun ()
710
DispatchService.GuiDispatch (delegate {
711
pad.FinishTestRun ();
714
public void Cancel ()
716
DispatchService.GuiDispatch (delegate {
720
public void BeginTest (UnitTest test)
722
DispatchService.GuiDispatch (delegate {
723
monitor.BeginTest (test);
726
public void EndTest (UnitTest test, UnitTestResult result)
728
DispatchService.GuiDispatch (delegate {
729
monitor.EndTest (test, result);
732
public void ReportRuntimeError (string message, Exception exception)
734
DispatchService.GuiDispatch (delegate {
735
monitor.ReportRuntimeError (message, exception);
690
738
public bool IsCancelRequested {
691
739
get { return monitor.IsCancelRequested; }