Browse Source

Removed Run All Tests context menu item from Unit Tests window. Code coverage window opened after all tests have been run with code coverage and there were no test failures. No longer using a static NCover runner which was raising events in two RunTestWithCodeCoverageCommand instances (toolbar, context menu) and causing one to try to read a test results file which no longer existed.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2329 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 19 years ago
parent
commit
78ff251b97
  1. BIN
      data/resources/StringResources.de.resources
  2. BIN
      data/resources/StringResources.es-mx.resources
  3. BIN
      data/resources/StringResources.es.resources
  4. BIN
      data/resources/StringResources.kr.resources
  5. BIN
      data/resources/StringResources.nl.resources
  6. BIN
      data/resources/StringResources.no.resources
  7. BIN
      data/resources/StringResources.pt.resources
  8. BIN
      data/resources/StringResources.ro.resources
  9. BIN
      data/resources/StringResources.tr.resources
  10. 6
      src/AddIns/Misc/CodeCoverage/CodeCoverage.sln
  11. 1
      src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj
  12. 36
      src/AddIns/Misc/CodeCoverage/Project/Src/NCoverRunnerSingleton.cs
  13. 23
      src/AddIns/Misc/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs
  14. 26
      src/AddIns/Misc/UnitTesting/Src/RunTestCommands.cs
  15. 4
      src/AddIns/Misc/UnitTesting/UnitTesting.addin
  16. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.de.resources

Binary file not shown.

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.kr.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

BIN
data/resources/StringResources.no.resources

Binary file not shown.

BIN
data/resources/StringResources.pt.resources

Binary file not shown.

BIN
data/resources/StringResources.ro.resources

Binary file not shown.

BIN
data/resources/StringResources.tr.resources

Binary file not shown.

6
src/AddIns/Misc/CodeCoverage/CodeCoverage.sln

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.1.0.1856

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
# SharpDevelop 2.1.0.2312
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCoverage", "Project\CodeCoverage.csproj", "{08CE9972-283B-44F4-82FA-966F7DFA6B7A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeCoverage.Tests", "Test\CodeCoverage.Tests.csproj", "{A5C0E8F8-9D04-46ED-91D6-1DEF1575313B}"

1
src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.csproj

@ -62,7 +62,6 @@ @@ -62,7 +62,6 @@
<Compile Include="Src\CodeCoverageDisplayItem.cs" />
<Compile Include="Src\ColorPickerComboBox.cs" />
<Compile Include="Src\NCoverRunner.cs" />
<Compile Include="Src\NCoverRunnerSingleton.cs" />
<Compile Include="Src\NCoverExitEventArgs.cs" />
<Compile Include="Src\CodeCoverageProjectOptionsPanel.cs" />
<EmbeddedResource Include="Resources\CodeCoverageProjectOptionsPanel.xfrm" />

36
src/AddIns/Misc/CodeCoverage/Project/Src/NCoverRunnerSingleton.cs

@ -1,36 +0,0 @@ @@ -1,36 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
namespace ICSharpCode.CodeCoverage
{
/// <summary>
/// Single NCover runner that is used by all commands.
/// </summary>
/// <remarks>
public class NCoverRunnerSingleton
{
static NCoverRunner runner;
NCoverRunnerSingleton()
{
}
/// <summary>
/// Gets the <see cref="NCoverRunner"/> instance.
/// </summary>
public static NCoverRunner Runner {
get {
if (runner == null) {
runner = new NCoverRunner();
}
return runner;
}
}
}
}

23
src/AddIns/Misc/CodeCoverage/Project/Src/RunTestWithCodeCoverageCommand.cs

@ -24,16 +24,14 @@ namespace ICSharpCode.CodeCoverage @@ -24,16 +24,14 @@ namespace ICSharpCode.CodeCoverage
public class RunTestWithCodeCoverageCommand : AbstractRunTestCommand
{
static MessageViewCategory category;
static NCoverRunner runner;
NCoverRunner runner;
string ncoverFileName;
public RunTestWithCodeCoverageCommand()
{
if (runner == null) {
runner = NCoverRunnerSingleton.Runner;
runner.NCoverExited += new NCoverExitEventHandler(NCoverExited);
runner.OutputLineReceived += new LineReceivedEventHandler(OutputLineReceived);
}
runner = new NCoverRunner();
runner.NCoverExited += new NCoverExitEventHandler(NCoverExited);
runner.OutputLineReceived += new LineReceivedEventHandler(OutputLineReceived);
}
protected override void RunTests(UnitTestApplicationStartHelper helper)
@ -65,6 +63,17 @@ namespace ICSharpCode.CodeCoverage @@ -65,6 +63,17 @@ namespace ICSharpCode.CodeCoverage
}
}
/// <summary>
/// Shows the code coverage results window only if there were no
/// test failures.
/// </summary>
protected override void OnAfterRunTests()
{
if (!TaskService.HasCriticalErrors(false)) {
ShowPad(WorkbenchSingleton.Workbench.GetPad(typeof(CodeCoveragePad)));
}
}
/// <summary>
/// Gets the message view output window.
/// </summary>
@ -126,8 +135,8 @@ namespace ICSharpCode.CodeCoverage @@ -126,8 +135,8 @@ namespace ICSharpCode.CodeCoverage
{
System.Diagnostics.Debug.Assert(e.Error.Length == 0);
WorkbenchSingleton.SafeThreadAsyncCall(TestsFinished);
DisplayCoverageResults(runner.CoverageResultsFileName);
WorkbenchSingleton.SafeThreadAsyncCall(TestsFinished);
}
void OutputLineReceived(object sender, LineReceivedEventArgs e)

26
src/AddIns/Misc/UnitTesting/Src/RunTestCommands.cs

@ -117,6 +117,14 @@ namespace ICSharpCode.UnitTesting @@ -117,6 +117,14 @@ namespace ICSharpCode.UnitTesting
protected virtual void OnBeforeRunTests()
{
}
/// <summary>
/// Called after all tests have been run even if there have
/// been errors. If multiple projects are to be tested this is called only once.
/// </summary>
protected virtual void OnAfterRunTests()
{
}
protected abstract void RunTests(UnitTestApplicationStartHelper helper);
@ -141,6 +149,7 @@ namespace ICSharpCode.UnitTesting @@ -141,6 +149,7 @@ namespace ICSharpCode.UnitTesting
if (TaskService.SomethingWentWrong && ErrorListPad.ShowAfterBuild) {
ShowErrorList();
}
OnAfterRunTests();
}
}
@ -162,6 +171,16 @@ namespace ICSharpCode.UnitTesting @@ -162,6 +171,16 @@ namespace ICSharpCode.UnitTesting
{
}
/// <summary>
/// Brings the specified pad to the front.
/// </summary>
protected void ShowPad(PadDescriptor padDescriptor)
{
if (padDescriptor != null) {
WorkbenchSingleton.SafeThreadAsyncCall(padDescriptor.BringPadToFront);
}
}
/// <summary>
/// Runs the tests after building the project under test.
/// </summary>
@ -269,13 +288,6 @@ namespace ICSharpCode.UnitTesting @@ -269,13 +288,6 @@ namespace ICSharpCode.UnitTesting
return null;
}
void ShowPad(PadDescriptor padDescriptor)
{
if (padDescriptor != null) {
WorkbenchSingleton.SafeThreadAsyncCall(padDescriptor.BringPadToFront);
}
}
void ShowErrorList()
{
ShowPad(WorkbenchSingleton.Workbench.GetPad(typeof(ErrorListPad)));

4
src/AddIns/Misc/UnitTesting/UnitTesting.addin

@ -131,10 +131,6 @@ @@ -131,10 +131,6 @@
<Condition name="RunningTests"/>
</Not>
</And>
<MenuItem id = "RunAll"
icon = "Icons.16x16.RunAllIcon"
label = "${res:NUnitPad.NUnitPadContent.RunAllTests}"
class = "ICSharpCode.UnitTesting.RunAllTestsInPadCommand"/>
<MenuItem id = "Run"
icon = "Icons.16x16.RunProgramIcon"
label = "${res:NUnitPad.NUnitPadContent.RunTestsContextMenuLabel}"

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save