forked from OpenCover/opencover
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A first pass at branch coverage - only conditional branches are instr…
…umented
- Loading branch information
Showing
10 changed files
with
178 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.IO; | ||
using NUnit.Framework; | ||
|
||
namespace OpenCover.Integration.Test | ||
{ | ||
public class BranchTests : ProfilerBaseFixture | ||
{ | ||
[Test] | ||
public void Execute_SimpleIf() | ||
{ | ||
_filter.AddFilter("+[OpenCover.Test]OpenCover.Test.Integration.SimpleBranchTests*"); | ||
ExecuteProfiler32((info) => | ||
{ | ||
info.FileName = Path.Combine(Environment.CurrentDirectory, | ||
@"..\..\..\tools\NUnit-2.5.9.10348\bin\net-2.0\nunit-console-x86.exe"); | ||
info.Arguments = | ||
"OpenCover.Test.dll /noshadow /run:OpenCover.Test.Integration.SimpleBranchTests.SimpleIf"; | ||
info.WorkingDirectory = Environment.CurrentDirectory; | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using NUnit.Framework; | ||
|
||
namespace OpenCover.Test.Integration | ||
{ | ||
[TestFixture(Description = "Theses tests are targets used for integration testing")] | ||
[Category("Integration")] | ||
[Explicit("Integration")] | ||
public class SimpleBranchTests | ||
{ | ||
[Test] | ||
public void SimpleIf() | ||
{ | ||
bool x = true; | ||
if (x) | ||
{ | ||
System.Diagnostics.Debug.WriteLine("X=SimpleIf(true)"); | ||
} | ||
else | ||
{ | ||
System.Diagnostics.Debug.WriteLine("X=SimpleIf(false)"); | ||
} | ||
|
||
bool y = true; | ||
if (!y) | ||
{ | ||
System.Diagnostics.Debug.WriteLine("Y=SimpleIf(true)"); | ||
} | ||
else | ||
{ | ||
System.Diagnostics.Debug.WriteLine("Y=SimpleIf(false)"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters