Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/addins/NUnit/Gui/TestResultsPad.cs')
-rw-r--r--main/src/addins/NUnit/Gui/TestResultsPad.cs36
1 files changed, 34 insertions, 2 deletions
diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs
index 1baf8b81e5..00c4fa75ea 100644
--- a/main/src/addins/NUnit/Gui/TestResultsPad.cs
+++ b/main/src/addins/NUnit/Gui/TestResultsPad.cs
@@ -42,6 +42,8 @@ using MonoDevelop.Components.Docking;
using MonoDevelop.Ide;
using System.Text.RegularExpressions;
using MonoDevelop.Components;
+using System.Threading;
+using MonoDevelop.Ide.Commands;
namespace MonoDevelop.NUnit
{
@@ -475,7 +477,34 @@ namespace MonoDevelop.NUnit
}
}
}
-
+
+ [CommandHandler (EditCommands.Copy)]
+ protected void OnCopy ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ var last = test.GetLastResult ();
+ if (last == null)
+ return;
+ var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
+ clipboard.Text = last.StackTrace;
+ }
+ }
+
+ [CommandUpdateHandler (EditCommands.Copy)]
+ protected void OnUpdateCopy (CommandInfo info)
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ var result = test.GetLastResult ();
+ if (result != null) {
+ info.Enabled = !string.IsNullOrEmpty (result.StackTrace);
+ return;
+ }
+ }
+ info.Enabled = false;
+ }
+
[CommandHandler (TestCommands.SelectTestInTree)]
protected void OnSelectTestInTree ()
{
@@ -704,11 +733,14 @@ namespace MonoDevelop.NUnit
{
ITestProgressMonitor monitor;
TestResultsPad pad;
+ CancellationTokenSource cs;
- public TestMonitor (TestResultsPad pad)
+ public TestMonitor (TestResultsPad pad, CancellationTokenSource cs)
{
this.pad = pad;
this.monitor = pad;
+ this.cs = cs;
+ cs.Token.Register (Cancel);
}
public void InitializeTestRun (UnitTest test)
{