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

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

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

Loading…
Cancel
Save