Browse Source

Code coverage results no longer being cleared after each test run when testing all projects in a solution.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6436 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 16 years ago
parent
commit
4b06e6a7b6
  1. 2
      src/AddIns/Analysis/UnitTesting/Src/AbstractRunTestCommand.cs
  2. 7
      src/AddIns/Analysis/UnitTesting/Test/Tree/RunTwoProjectsTestsTestFixture.cs
  3. 6
      src/AddIns/Analysis/UnitTesting/Test/Utils/DerivedRunTestCommand.cs

2
src/AddIns/Analysis/UnitTesting/Src/AbstractRunTestCommand.cs

@ -303,13 +303,13 @@ namespace ICSharpCode.UnitTesting
void RunTests(SelectedTests selectedTests) void RunTests(SelectedTests selectedTests)
{ {
if (testProgressMonitor == null) { if (testProgressMonitor == null) {
OnBeforeRunTests();
testProgressMonitor = context.StatusBarService.CreateProgressMonitor(); testProgressMonitor = context.StatusBarService.CreateProgressMonitor();
totalProjectCount = selectedTests.Projects.Count; totalProjectCount = selectedTests.Projects.Count;
} }
testProgressMonitor.TaskName = GetProgressMonitorLabel(selectedTests.Project); testProgressMonitor.TaskName = GetProgressMonitorLabel(selectedTests.Project);
testProgressMonitor.Progress = GetProgress(selectedTests.Projects); testProgressMonitor.Progress = GetProgress(selectedTests.Projects);
OnBeforeRunTests();
testRunner = CreateTestRunner(selectedTests.Project); testRunner = CreateTestRunner(selectedTests.Project);
if (testRunner != null) { if (testRunner != null) {
StartTestRunner(); StartTestRunner();

7
src/AddIns/Analysis/UnitTesting/Test/Tree/RunTwoProjectsTestsTestFixture.cs

@ -68,5 +68,12 @@ namespace UnitTesting.Tests.Tree
runTestCommand.CallTestsCompleted(); runTestCommand.CallTestsCompleted();
Assert.IsFalse(AbstractRunTestCommand.IsRunningTest); Assert.IsFalse(AbstractRunTestCommand.IsRunningTest);
} }
[Test]
public void OnBeforeTestRunIsCalledOnlyOnce()
{
int count = runTestCommand.OnBeforeRunTestsMethodCallCount;
Assert.AreEqual(1, count);
}
} }
} }

6
src/AddIns/Analysis/UnitTesting/Test/Utils/DerivedRunTestCommand.cs

@ -21,6 +21,7 @@ namespace UnitTesting.Tests.Utils
public bool IsRunningTestWhenOnBeforeBuildCalled; public bool IsRunningTestWhenOnBeforeBuildCalled;
public bool IsOnStopMethodCalled; public bool IsOnStopMethodCalled;
public List<MockTestRunner> TestRunnersCreated = new List<MockTestRunner>(); public List<MockTestRunner> TestRunnersCreated = new List<MockTestRunner>();
public int OnBeforeRunTestsMethodCallCount;
public DerivedRunTestCommand(IRunTestCommandContext context) public DerivedRunTestCommand(IRunTestCommandContext context)
: base(context) : base(context)
@ -74,5 +75,10 @@ namespace UnitTesting.Tests.Utils
{ {
return CreateTestRunner(project); return CreateTestRunner(project);
} }
protected override void OnBeforeRunTests()
{
OnBeforeRunTestsMethodCallCount++;
}
} }
} }

Loading…
Cancel
Save