Browse Source

Implemented test runner.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
dc76823be9
  1. 12
      src/AddIns/Analysis/UnitTesting/Frameworks/SDTestService.cs
  2. 4
      src/AddIns/Analysis/UnitTesting/Model/ITestProject.cs
  3. 2
      src/AddIns/Analysis/UnitTesting/Model/TestNamespace.cs
  4. 3
      src/AddIns/Analysis/UnitTesting/Model/TestProjectBase.cs
  5. 40
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs
  6. 13
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestMethod.cs
  7. 43
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestProject.cs
  8. 4
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestRunner.cs
  9. 0
      src/AddIns/Analysis/UnitTesting/Pad/ITestTreeView.cs
  10. 0
      src/AddIns/Analysis/UnitTesting/Pad/TestTreeView.cs
  11. 0
      src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs
  12. 5
      src/AddIns/Analysis/UnitTesting/Pad/UnitTestsPad.cs
  13. 0
      src/AddIns/Analysis/UnitTesting/TestRunner/ITestResultsMonitor.cs
  14. 8
      src/AddIns/Analysis/UnitTesting/TestRunner/ITestRunner.cs
  15. 64
      src/AddIns/Analysis/UnitTesting/TestRunner/TestExecutionManager.cs
  16. 0
      src/AddIns/Analysis/UnitTesting/TestRunner/TestExecutionOptions.cs
  17. 27
      src/AddIns/Analysis/UnitTesting/TestRunner/TestProcessRunnerBase.cs
  18. 28
      src/AddIns/Analysis/UnitTesting/TestRunner/TestRunnerBase.cs
  19. 25
      src/AddIns/Analysis/UnitTesting/UnitTesting.csproj
  20. 5
      src/Main/Base/Project/Src/Gui/Dialogs/AsynchronousWaitDialog.cs
  21. 7
      src/Main/Base/Project/Src/Gui/IProgressMonitor.cs
  22. 5
      src/Main/Base/Project/Src/Gui/ProgressCollector.cs

12
src/AddIns/Analysis/UnitTesting/Frameworks/SDTestService.cs

@ -68,12 +68,20 @@ namespace ICSharpCode.UnitTesting @@ -68,12 +68,20 @@ namespace ICSharpCode.UnitTesting
get { return runTestsCancellationTokenSource != null; }
}
public Task RunTestsAsync(IEnumerable<ITest> selectedTests, TestExecutionOptions options)
public async Task RunTestsAsync(IEnumerable<ITest> selectedTests, TestExecutionOptions options)
{
CancelRunningTests();
runTestsCancellationTokenSource = new CancellationTokenSource();
// invalidate commands as IsRunningTests changes
System.Windows.Input.CommandManager.InvalidateRequerySuggested();
var executionManager = new TestExecutionManager();
return executionManager.RunTestsAsync(selectedTests, options, runTestsCancellationTokenSource.Token);
try {
await executionManager.RunTestsAsync(selectedTests, options, runTestsCancellationTokenSource.Token);
} finally {
runTestsCancellationTokenSource = null;
// invalidate commands as IsRunningTests changes
System.Windows.Input.CommandManager.InvalidateRequerySuggested();
}
}
public void CancelRunningTests()

4
src/AddIns/Analysis/UnitTesting/Model/ITestProject.cs

@ -42,6 +42,8 @@ namespace ICSharpCode.UnitTesting @@ -42,6 +42,8 @@ namespace ICSharpCode.UnitTesting
/// <summary>
/// Runs the specified tests. The specified tests must belong to this project.
/// </summary>
Task RunTestsAsync(IEnumerable<ITest> tests, TestExecutionOptions options, IProgressMonitor progressMonitor);
ITestRunner CreateTestRunner(TestExecutionOptions options);
void UpdateTestResult(TestResult result);
}
}

2
src/AddIns/Analysis/UnitTesting/Model/TestNamespace.cs

@ -26,7 +26,7 @@ namespace ICSharpCode.UnitTesting @@ -26,7 +26,7 @@ namespace ICSharpCode.UnitTesting
if (displayName != null) {
this.displayName = displayName;
} else {
this.displayName = namespaceName.Substring(namespaceName.IndexOf('.') + 1);
this.displayName = namespaceName.Substring(namespaceName.LastIndexOf('.') + 1);
}
BindResultToCompositeResultOfNestedTests();
}

3
src/AddIns/Analysis/UnitTesting/Model/TestProjectBase.cs

@ -33,8 +33,9 @@ namespace ICSharpCode.UnitTesting @@ -33,8 +33,9 @@ namespace ICSharpCode.UnitTesting
BindResultToCompositeResultOfNestedTests();
}
public abstract Task RunTestsAsync(IEnumerable<ITest> tests, TestExecutionOptions options, IProgressMonitor progressMonitor);
public abstract ITestRunner CreateTestRunner(TestExecutionOptions options);
public abstract ITest GetTestForEntity(IEntity entity);
public abstract void UpdateTestResult(TestResult result);
// Test class management methods
public abstract bool IsTestClass(ITypeDefinition typeDefinition);

40
src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs

@ -5,8 +5,8 @@ using System; @@ -5,8 +5,8 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
@ -16,34 +16,33 @@ namespace ICSharpCode.UnitTesting @@ -16,34 +16,33 @@ namespace ICSharpCode.UnitTesting
{
public class NUnitConsoleApplication
{
/*
public NUnitConsoleApplication(ITestProject project, IEnumerable<ITest> selectedTests, UnitTestingOptions options)
public NUnitConsoleApplication(IEnumerable<ITest> selectedTests, UnitTestingOptions options)
{
Initialize(project, selectedTests);
Initialize(selectedTests);
InitializeOptions(options);
}
public NUnitConsoleApplication(ITestProject project, IEnumerable<ITest> selectedTests)
public NUnitConsoleApplication(IEnumerable<ITest> selectedTests)
{
Initialize(project, selectedTests);
Initialize(selectedTests);
}
void Initialize(ITestProject project, IEnumerable<ITest> selectedTests)
void Initialize(IEnumerable<ITest> selectedTests)
{
this.selectedTests = selectedTests;
this.project = selectedTests.Project;
ITest test = selectedTests.Single();
this.project = test.ParentProject.Project;
Assemblies.Add(project.OutputAssemblyFullPath);
if (selectedTests.NamespaceFilter != null) {
NamespaceFilter = selectedTests.NamespaceFilter;
}
if (selectedTests.Class != null) {
Fixture = selectedTests.Class.QualifiedName;
if (selectedTests.Member != null) {
Test = selectedTests.Member.Member.Name;
}
if (test is TestNamespace) {
NamespaceFilter = ((TestNamespace)test).NamespaceName;
} else if (test is NUnitTestClass) {
var testClass = (NUnitTestClass)test;
Fixture = testClass.ReflectionName;
} else if (test is NUnitTestMethod) {
var testMethod = (NUnitTestMethod)test;
Fixture = testMethod.FixtureReflectionName;
Test = testMethod.Name;
}
}
*/
void InitializeOptions(UnitTestingOptions options)
{
@ -152,11 +151,6 @@ namespace ICSharpCode.UnitTesting @@ -152,11 +151,6 @@ namespace ICSharpCode.UnitTesting
public string NamespaceFilter;
IProject project;
IEnumerable<ITest> selectedTests;
public IEnumerable<ITest> SelectedTests {
get { return selectedTests; }
}
public IProject Project {
get { return project; }

13
src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestMethod.cs

@ -31,5 +31,18 @@ namespace ICSharpCode.UnitTesting @@ -31,5 +31,18 @@ namespace ICSharpCode.UnitTesting
public override string DisplayName {
get { return method.Name; }
}
public string Name {
get { return method.Name; }
}
public string FixtureReflectionName {
get { return method.DeclaringTypeDefinition.ReflectionName; }
}
public void UpdateTestResult(TestResult result)
{
this.Result = result.ResultType;
}
}
}

43
src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestProject.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
@ -20,9 +21,12 @@ namespace ICSharpCode.UnitTesting @@ -20,9 +21,12 @@ namespace ICSharpCode.UnitTesting
{
}
public override Task RunTestsAsync(IEnumerable<ITest> tests, TestExecutionOptions options, IProgressMonitor progressMonitor)
public override ITestRunner CreateTestRunner(TestExecutionOptions options)
{
throw new NotImplementedException();
if (options.UseDebugger)
return new NUnitTestDebugger();
else
return new NUnitTestRunner();
}
public override void UpdateTestClass(ITest test, ITypeDefinition typeDefinition)
@ -56,5 +60,40 @@ namespace ICSharpCode.UnitTesting @@ -56,5 +60,40 @@ namespace ICSharpCode.UnitTesting
else
return null;
}
public override void UpdateTestResult(TestResult result)
{
int pos = result.Name.LastIndexOf('.');
if (pos < 0)
return;
string fixtureName = result.Name.Substring(0, pos);
string methodName = result.Name.Substring(pos + 1);
var testClass = FindTestClass(fixtureName);
if (testClass != null) {
var testMethod = testClass.NestedTests.OfType<NUnitTestMethod>().FirstOrDefault(m => m.Name == methodName);
if (testMethod != null) {
testMethod.UpdateTestResult(result);
}
}
}
NUnitTestClass FindTestClass(string fixtureName)
{
ITypeReference r = ReflectionHelper.ParseReflectionName(fixtureName);
return FindTestClass(r);
}
NUnitTestClass FindTestClass(ITypeReference r)
{
var gctr = r as GetClassTypeReference;
if (gctr != null) {
return (NUnitTestClass)GetTestClass(new FullNameAndTypeParameterCount(gctr.Namespace, gctr.Name, gctr.TypeParameterCount));
}
var ntc = r as NestedTypeReference;
if (ntc != null) {
}
return null;
}
}
}

4
src/AddIns/Analysis/UnitTesting/NUnit/NUnitTestRunner.cs

@ -4,7 +4,9 @@ @@ -4,7 +4,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
namespace ICSharpCode.UnitTesting

0
src/AddIns/Analysis/UnitTesting/TreeView/ITestTreeView.cs → src/AddIns/Analysis/UnitTesting/Pad/ITestTreeView.cs

0
src/AddIns/Analysis/UnitTesting/TreeView/TestTreeView.cs → src/AddIns/Analysis/UnitTesting/Pad/TestTreeView.cs

0
src/AddIns/Analysis/UnitTesting/TreeView/UnitTestNode.cs → src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs

5
src/AddIns/Analysis/UnitTesting/Pad/UnitTestsPad.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
@ -35,12 +36,12 @@ namespace ICSharpCode.UnitTesting @@ -35,12 +36,12 @@ namespace ICSharpCode.UnitTesting
this.testService = testService;
panel = new DockPanel();
treeView = new TestTreeView(); // treeView must be created first because it's used by CreateToolBar
toolBar = CreateToolBar("/SharpDevelop/Pads/UnitTestsPad/Toolbar");
panel.Children.Add(toolBar);
DockPanel.SetDock(toolBar, Dock.Top);
treeView = new TestTreeView();
panel.Children.Add(treeView);
treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu");
@ -70,6 +71,7 @@ namespace ICSharpCode.UnitTesting @@ -70,6 +71,7 @@ namespace ICSharpCode.UnitTesting
/// </summary>
protected virtual ToolBar CreateToolBar(string name)
{
Debug.Assert(treeView != null);
return ToolBarService.CreateToolBar(treeView, treeView, name);
}
@ -79,6 +81,7 @@ namespace ICSharpCode.UnitTesting @@ -79,6 +81,7 @@ namespace ICSharpCode.UnitTesting
/// </summary>
protected virtual ContextMenu CreateContextMenu(string name)
{
Debug.Assert(treeView != null);
return MenuService.CreateContextMenu(treeView, name);
}
}

0
src/AddIns/Analysis/UnitTesting/Frameworks/ITestResultsMonitor.cs → src/AddIns/Analysis/UnitTesting/TestRunner/ITestResultsMonitor.cs

8
src/AddIns/Analysis/UnitTesting/TestRunner/ITestRunner.cs

@ -3,6 +3,9 @@ @@ -3,6 +3,9 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
namespace ICSharpCode.UnitTesting
@ -10,9 +13,8 @@ namespace ICSharpCode.UnitTesting @@ -10,9 +13,8 @@ namespace ICSharpCode.UnitTesting
public interface ITestRunner : IDisposable
{
event EventHandler<TestFinishedEventArgs> TestFinished;
event EventHandler AllTestsFinished;
event EventHandler<MessageReceivedEventArgs> MessageReceived;
void Start(IEnumerable<ITest> selectedTests);
void Stop();
Task RunAsync(IEnumerable<ITest> selectedTests, IProgress<double> progress, CancellationToken cancellationToken);
}
}

64
src/AddIns/Analysis/UnitTesting/Frameworks/TestExecutionManager.cs → src/AddIns/Analysis/UnitTesting/TestRunner/TestExecutionManager.cs

@ -27,6 +27,7 @@ namespace ICSharpCode.UnitTesting.Frameworks @@ -27,6 +27,7 @@ namespace ICSharpCode.UnitTesting.Frameworks
readonly IUnitTestSaveAllFilesCommand saveAllFilesCommand;
readonly ITestService testService;
readonly IWorkbench workbench;
readonly IMessageLoop mainThread;
readonly IStatusBarService statusBarService;
readonly IBuildOptions buildOptions;
@ -38,11 +39,14 @@ namespace ICSharpCode.UnitTesting.Frameworks @@ -38,11 +39,14 @@ namespace ICSharpCode.UnitTesting.Frameworks
this.testService = SD.GetRequiredService<ITestService>();
this.workbench = SD.Workbench;
this.statusBarService = SD.StatusBar;
this.mainThread = SD.MainThread;
this.buildOptions = new UnitTestBuildOptions();
}
readonly MultiDictionary<ITestProject, ITest> testsByProject = new MultiDictionary<ITestProject, ITest>();
CancellationToken cancellationToken;
ITestProject currentProjectBeingTested;
IProgressMonitor testProgressMonitor;
public async Task RunTestsAsync(IEnumerable<ITest> selectedTests, TestExecutionOptions options, CancellationToken cancellationToken)
{
@ -69,11 +73,15 @@ namespace ICSharpCode.UnitTesting.Frameworks @@ -69,11 +73,15 @@ namespace ICSharpCode.UnitTesting.Frameworks
using (IProgressMonitor progressMonitor = statusBarService.CreateProgressMonitor(cancellationToken)) {
int projectsLeftToRun = testsByProject.Count;
foreach (IGrouping<ITestProject, ITest> g in testsByProject) {
ITestProject project = g.Key;
progressMonitor.TaskName = GetProgressMonitorLabel(project);
currentProjectBeingTested = g.Key;
progressMonitor.TaskName = GetProgressMonitorLabel(currentProjectBeingTested);
progressMonitor.Progress = GetProgress(projectsLeftToRun);
using (IProgressMonitor nested = progressMonitor.CreateSubTask(1.0 / testsByProject.Count)) {
await project.RunTestsAsync(g, options, nested);
using (testProgressMonitor = progressMonitor.CreateSubTask(1.0 / testsByProject.Count)) {
using (ITestRunner testRunner = currentProjectBeingTested.CreateTestRunner(options)) {
testRunner.MessageReceived += testRunner_MessageReceived;
testRunner.TestFinished += testRunner_TestFinished;
await testRunner.RunAsync(g, testProgressMonitor, testProgressMonitor.CancellationToken);
}
}
projectsLeftToRun--;
progressMonitor.CancellationToken.ThrowIfCancellationRequested();
@ -139,6 +147,54 @@ namespace ICSharpCode.UnitTesting.Frameworks @@ -139,6 +147,54 @@ namespace ICSharpCode.UnitTesting.Frameworks
return (double)(totalProjectCount - projectsLeftToRunCount) / totalProjectCount;
}
void testRunner_MessageReceived(object sender, MessageReceivedEventArgs e)
{
testService.UnitTestMessageView.AppendLine(e.Message);
}
void testRunner_TestFinished(object sender, TestFinishedEventArgs e)
{
mainThread.InvokeAsync(delegate { ShowResult(e.Result); }).FireAndForget();
}
protected void ShowResult(TestResult result)
{
if (IsTestResultFailureOrIsIgnored(result)) {
AddTaskForTestResult(result);
UpdateProgressMonitorStatus(result);
}
UpdateTestResult(result);
}
bool IsTestResultFailureOrIsIgnored(TestResult result)
{
return result.IsFailure || result.IsIgnored;
}
void AddTaskForTestResult(TestResult testResult)
{
SDTask task = TestResultTask.Create(testResult, currentProjectBeingTested);
taskService.Add(task);
}
void UpdateProgressMonitorStatus(TestResult result)
{
if (testProgressMonitor != null) {
if (result.IsFailure) {
testProgressMonitor.Status = OperationStatus.Error;
} else if (result.IsIgnored && testProgressMonitor.Status == OperationStatus.Normal) {
testProgressMonitor.Status = OperationStatus.Warning;
}
}
}
void UpdateTestResult(TestResult result)
{
if (currentProjectBeingTested != null) {
currentProjectBeingTested.UpdateTestResult(result);
}
}
void ShowErrorList()
{
if (taskService.SomethingWentWrong && buildOptions.ShowErrorListAfterBuild) {

0
src/AddIns/Analysis/UnitTesting/Frameworks/TestExecutionOptions.cs → src/AddIns/Analysis/UnitTesting/TestRunner/TestExecutionOptions.cs

27
src/AddIns/Analysis/UnitTesting/TestRunner/TestProcessRunnerBase.cs

@ -18,31 +18,12 @@ namespace ICSharpCode.UnitTesting @@ -18,31 +18,12 @@ namespace ICSharpCode.UnitTesting
IFileSystem fileSystem;
IMessageService messageService;
public TestProcessRunnerBase()
: this(new UnitTestProcessRunner(),
new TestResultsMonitor(),
new UnitTestFileService(),
SD.MessageService)
{
}
public TestProcessRunnerBase(TestProcessRunnerBaseContext context)
: this(context.TestProcessRunner,
context.TestResultsMonitor,
context.FileSystem,
context.MessageService)
{
}
public TestProcessRunnerBase(IUnitTestProcessRunner processRunner,
ITestResultsMonitor testResultsMonitor,
IFileSystem fileSystem,
IMessageService messageService)
{
this.processRunner = processRunner;
this.testResultsMonitor = testResultsMonitor;
this.fileSystem = fileSystem;
this.messageService = messageService;
this.processRunner = context.TestProcessRunner;
this.testResultsMonitor = context.TestResultsMonitor;
this.fileSystem = context.FileSystem;
this.messageService = context.MessageService;
processRunner.LogStandardOutputAndError = false;
processRunner.OutputLineReceived += OutputLineReceived;

28
src/AddIns/Analysis/UnitTesting/TestRunner/TestRunnerBase.cs

@ -4,13 +4,29 @@ @@ -4,13 +4,29 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace ICSharpCode.UnitTesting
{
public abstract class TestRunnerBase : ITestRunner
{
public TestRunnerBase()
TaskCompletionSource<object> tcs;
CancellationTokenRegistration cancellationTokenRegistration;
bool wasCancelled;
public Task RunAsync(IEnumerable<ITest> selectedTests, IProgress<double> progress, CancellationToken cancellationToken)
{
tcs = new TaskCompletionSource<object>();
Start(selectedTests);
cancellationTokenRegistration = cancellationToken.Register(Cancel, true);
return tcs.Task;
}
void Cancel()
{
wasCancelled = true;
Stop();
}
protected virtual ProcessStartInfo GetProcessStartInfo(IEnumerable<ITest> selectedTests)
@ -29,13 +45,13 @@ namespace ICSharpCode.UnitTesting @@ -29,13 +45,13 @@ namespace ICSharpCode.UnitTesting
return String.Format("\"{0}\" {1}", startInfo.FileName, startInfo.Arguments);
}
public event EventHandler AllTestsFinished;
protected void OnAllTestsFinished(object source, EventArgs e)
{
if (AllTestsFinished != null) {
AllTestsFinished(source, e);
}
cancellationTokenRegistration.Dispose();
if (wasCancelled)
tcs.SetCanceled();
else
tcs.SetResult(e);
}
public event EventHandler<TestFinishedEventArgs> TestFinished;

25
src/AddIns/Analysis/UnitTesting/UnitTesting.csproj

@ -71,8 +71,6 @@ @@ -71,8 +71,6 @@
<Compile Include="Commands\TestableCondition.cs" />
<Compile Include="Commands\UnitTestCommands.cs" />
<Compile Include="Frameworks\ITestService.cs" />
<Compile Include="Frameworks\TestExecutionManager.cs" />
<Compile Include="Frameworks\TestExecutionOptions.cs" />
<Compile Include="Interfaces\IUnitTestProcessRunner.cs" />
<Compile Include="Interfaces\UnitTestProcessRunner.cs" />
<Compile Include="Model\ITest.cs" />
@ -93,8 +91,13 @@ @@ -93,8 +91,13 @@
<Compile Include="Model\TestResult.cs" />
<Compile Include="Model\TestResultTypeChangedEventArgs.cs" />
<Compile Include="NUnit\NUnitTestClass.cs" />
<Compile Include="NUnit\NUnitTestDebugger.cs" />
<Compile Include="NUnit\NUnitTestMethod.cs" />
<Compile Include="NUnit\NUnitTestProject.cs" />
<Compile Include="NUnit\NUnitTestRunner.cs" />
<Compile Include="Pad\ITestTreeView.cs" />
<Compile Include="Pad\TestTreeView.cs" />
<Compile Include="Pad\UnitTestNode.cs" />
<Compile Include="Pad\UnitTestsPad.cs" />
<Compile Include="Interfaces\UnitTestBuildProjectFactory.cs" />
<Compile Include="Interfaces\UnitTestDebuggerService.cs" />
@ -105,9 +108,19 @@ @@ -105,9 +108,19 @@
<Compile Include="Frameworks\TestFrameworkDescriptor.cs" />
<Compile Include="Frameworks\TestFrameworkDoozer.cs" />
<Compile Include="Frameworks\SDTestService.cs" />
<Compile Include="TreeView\ITestTreeView.cs" />
<Compile Include="TreeView\TestTreeView.cs" />
<Compile Include="TreeView\UnitTestNode.cs" />
<Compile Include="TestRunner\ITestResultsMonitor.cs" />
<Compile Include="TestRunner\ITestRunner.cs" />
<Compile Include="TestRunner\MessageReceivedEventArgs.cs" />
<Compile Include="TestRunner\TestDebuggerBase.cs" />
<Compile Include="TestRunner\TestExecutionManager.cs" />
<Compile Include="TestRunner\TestExecutionOptions.cs" />
<Compile Include="TestRunner\TestFinishedEventArgs.cs" />
<Compile Include="TestRunner\TestProcessRunnerBase.cs" />
<Compile Include="TestRunner\TestProcessRunnerBaseContext.cs" />
<Compile Include="TestRunner\TestResultsMonitor.cs" />
<Compile Include="TestRunner\TestResultsReader.cs" />
<Compile Include="TestRunner\TestResultTask.cs" />
<Compile Include="TestRunner\TestRunnerBase.cs" />
<Compile Include="NUnit\NUnitConsoleApplication.cs" />
<Compile Include="NUnit\NUnitTestFramework.cs" />
<Compile Include="NUnit\NUnitTestResult.cs" />
@ -174,7 +187,7 @@ @@ -174,7 +187,7 @@
<Folder Include="Model" />
<Folder Include="Options" />
<Folder Include="NUnit" />
<Folder Include="TreeView" />
<Folder Include="TestRunner" />
</ItemGroup>
<ItemGroup>
<Page Include="Options\UnitTestingOptionsPanel.xaml" />

5
src/Main/Base/Project/Src/Gui/Dialogs/AsynchronousWaitDialog.cs

@ -288,6 +288,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -288,6 +288,11 @@ namespace ICSharpCode.SharpDevelop.Gui
set { collector.ProgressMonitor.Progress = value; }
}
void IProgress<double>.Report(double value)
{
this.Progress = value;
}
/// <inheritdoc/>
public bool ShowingDialog {
get { return collector.ProgressMonitor.ShowingDialog; }

7
src/Main/Base/Project/Src/Gui/IProgressMonitor.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// automatically sent to the correct GUI thread.
/// Using a progress monitor from multiple threads is possible if the user synchronizes the access.
/// </remarks>
public interface IProgressMonitor : IDisposable
public interface IProgressMonitor : IDisposable, IProgress<double>
{
/// <summary>
/// Gets/Sets the amount of work already done within this task.
@ -115,6 +115,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -115,6 +115,11 @@ namespace ICSharpCode.SharpDevelop.Gui
return new DummyProgressMonitor() { CancellationToken = cancellationToken };
}
void IProgress<double>.Report(double value)
{
this.Progress = value;
}
public void Dispose()
{
}

5
src/Main/Base/Project/Src/Gui/ProgressCollector.cs

@ -266,6 +266,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -266,6 +266,11 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
void IProgress<double>.Report(double value)
{
this.Progress = value;
}
void UpdateProgress(double progress)
{
if (parent != null)

Loading…
Cancel
Save