diff options
author | David Karlaš <david.karlas@xamarin.com> | 2015-11-24 20:46:28 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2015-11-24 20:46:28 +0300 |
commit | fdcef13057a9c4a9bc924602c9b2b33c1da3bf63 (patch) | |
tree | f5d45bca682a39c3946dbd9fee281e152288a4aa /main/src/addins/NUnit | |
parent | ee4190106f0d102c4fdce57fc3c5637cbce7b9aa (diff) | |
parent | 07a993cf6d80660fde31099c1aca8029a3035807 (diff) |
Merge branch 'master' into newExceptionDialog
Diffstat (limited to 'main/src/addins/NUnit')
-rw-r--r-- | main/src/addins/NUnit/Commands/NUnitCommands.cs | 3 | ||||
-rw-r--r-- | main/src/addins/NUnit/Gui/TestResultsPad.cs | 40 | ||||
-rw-r--r-- | main/src/addins/NUnit/MonoDevelop.NUnit.csproj | 2 | ||||
-rw-r--r-- | main/src/addins/NUnit/MonoDevelopNUnit.addin.xml | 2 |
4 files changed, 39 insertions, 8 deletions
diff --git a/main/src/addins/NUnit/Commands/NUnitCommands.cs b/main/src/addins/NUnit/Commands/NUnitCommands.cs index f0d9322df4..0a581fdb81 100644 --- a/main/src/addins/NUnit/Commands/NUnitCommands.cs +++ b/main/src/addins/NUnit/Commands/NUnitCommands.cs @@ -41,7 +41,8 @@ namespace MonoDevelop.NUnit.Commands ShowTestCode, SelectTestInTree, ShowTestDetails, - GoToFailure + GoToFailure, + RerunTest, } public enum TestChartCommands diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs index 7758886781..5110f4de4d 100644 --- a/main/src/addins/NUnit/Gui/TestResultsPad.cs +++ b/main/src/addins/NUnit/Gui/TestResultsPad.cs @@ -213,7 +213,7 @@ namespace MonoDevelop.NUnit buttonRun = new Button (); buttonRun.Label = GettextCatalog.GetString ("Rerun Tests"); - buttonRun.Image = new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu); + buttonRun.Image = new ImageView (ImageService.GetIcon ("nunit-run", IconSize.Menu)); buttonRun.Image.Show (); buttonRun.Sensitive = false; toolbar.Add (buttonRun); @@ -250,6 +250,8 @@ namespace MonoDevelop.NUnit progressBar.HeightRequest = infoLabel.SizeRequest ().Height; runPanel.ShowAll (); + progressBar.Hide (); + infoSep.Hide (); resultSummary = new UnitTestResult (); UpdateCounters (); } @@ -289,7 +291,9 @@ namespace MonoDevelop.NUnit progressBar.Text = ""; testsRun = 0; resultSummary = new UnitTestResult (); - resultLabel.Markup = GetResultsMarkup (); + resultLabel.Markup = ""; + resultLabel.Hide (); + labels.Show (); UpdateCounters (); } @@ -512,7 +516,7 @@ namespace MonoDevelop.NUnit Gtk.TreeIter iter; if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) return; - + int type = (int)failuresStore.GetValue (iter, 5); var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false)); @@ -535,9 +539,23 @@ namespace MonoDevelop.NUnit { UnitTest test = GetSelectedTest (); if (test != null) { - var result = test.GetLastResult (); - if (result != null) { - info.Enabled = !string.IsNullOrEmpty (result.StackTrace); + var last = test.GetLastResult (); + + Gtk.TreeModel foo; + Gtk.TreeIter iter; + if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) { + info.Enabled = false; + return; + } + + int type = (int)failuresStore.GetValue (iter, 5); + switch (type) { + case ErrorMessage: + info.Enabled = !string.IsNullOrEmpty (last.Message); + return; + case StackTrace: + default: + info.Enabled = !string.IsNullOrEmpty (last.StackTrace); return; } } @@ -586,9 +604,19 @@ namespace MonoDevelop.NUnit if (loc != null) IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column); } + + [CommandHandler (TestCommands.RerunTest)] + protected void OnRerunTest () + { + UnitTest test = GetSelectedTest (); + if (test == null) + return; + NUnitService.Instance.RunTest (test, null); + } [CommandUpdateHandler (TestCommands.ShowTestCode)] [CommandUpdateHandler (TestCommands.GoToFailure)] + [CommandUpdateHandler (TestCommands.RerunTest)] protected void OnUpdateRunTest (CommandInfo info) { UnitTest test = GetSelectedTest (); diff --git a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj index 65cda081fd..40f784226e 100644 --- a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj +++ b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj @@ -30,7 +30,7 @@ <Optimize>True</Optimize> <OutputPath>..\..\..\build\AddIns\NUnit\</OutputPath> <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> + <WarningLevel>3</WarningLevel> <Execution> <Execution clr-version="Net_2_0" /> </Execution> diff --git a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml b/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml index 96f4fb6295..25aef50656 100644 --- a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml +++ b/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml @@ -91,6 +91,7 @@ <Command id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" _label = "Go to failure" /> <Command id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" _label = "Select test in tree" /> <Command id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestDetails" _label = "Show results pad" /> + <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" _label = "Rerun test" /> <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.UseTimeScale" _label = "Proportional time scale" type="check"/> <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.SingleDayResult" _label = "Show one result per day" type="check"/> <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowResults" _label = "Results chart" type="radio"/> @@ -136,6 +137,7 @@ <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" /> <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" /> <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" /> + <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" /> <SeparatorItem id = "s1" /> <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Copy" /> </Extension> |