Browse Source

Fixes for CodeCoverage.

pull/50/head
Dirk Lemstra 9 years ago
parent
commit
ca42f82295
  1. 1
      src/ImageSharp/project.json
  2. 3
      tests/CodeCoverage/CodeCoverage.cmd
  3. 23
      tests/ImageSharp.Tests/TestImages.cs
  4. 4
      tests/ImageSharp.Tests/project.json

1
src/ImageSharp/project.json

@ -23,7 +23,6 @@
},
"buildOptions": {
"allowUnsafe": true,
"debugType": "portable",
"xmlDoc": true,
"additionalArguments": [ "/additionalfile:stylecop.json" ]
},

3
tests/CodeCoverage/CodeCoverage.cmd

@ -8,7 +8,8 @@ cd ..\ImageSharp.Tests
dotnet restore
..\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -c Release" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -oldStyle -output:.\ImageSharp.Coverage.xml
rem The -threshold options prevents this taking ages...
..\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -c Release -f net451" -threshold:10 -register:user -filter:"+[ImageSharp*]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -output:.\ImageSharp.Coverage.xml
SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%
pip install codecov

23
tests/ImageSharp.Tests/TestImages.cs

@ -5,14 +5,29 @@
namespace ImageSharp.Tests
{
using System.IO;
/// <summary>
/// Class that contains all the test images.
/// </summary>
public static class TestImages
{
private static readonly string FormatsDirectory = GetFormatsDirectory();
private static string GetFormatsDirectory()
{
// Here for code coverage tests.
string directory = "TestImages/Formats/";
if (Directory.Exists(directory))
{
return directory;
}
return "../../../../TestImages/Formats/";
}
public static class Png
{
private static readonly string folder = "TestImages/Formats/Png/";
private static readonly string folder = FormatsDirectory + "Png/";
public static TestFile P1 => new TestFile(folder + "pl.png");
public static TestFile Pd => new TestFile(folder + "pd.png");
@ -37,7 +52,7 @@ namespace ImageSharp.Tests
public static class Jpeg
{
private static readonly string folder = "TestImages/Formats/Jpg/";
private static readonly string folder = FormatsDirectory + "Jpg/";
public static TestFile Cmyk => new TestFile(folder + "cmyk.jpg");
public static TestFile Exif => new TestFile(folder + "exif.jpg");
@ -67,7 +82,7 @@ namespace ImageSharp.Tests
public static class Bmp
{
private static readonly string folder = "TestImages/Formats/Bmp/";
private static readonly string folder = FormatsDirectory + "Bmp/";
public static TestFile Car => new TestFile(folder + "Car.bmp");
@ -82,7 +97,7 @@ namespace ImageSharp.Tests
public static class Gif
{
private static readonly string folder = "TestImages/Formats/Gif/";
private static readonly string folder = FormatsDirectory + "Gif/";
public static TestFile Rings => new TestFile(folder + "rings.gif");
public static TestFile Giphy => new TestFile(folder + "giphy.gif");

4
tests/ImageSharp.Tests/project.json

@ -10,7 +10,6 @@
]
},
"buildOptions": {
"debugType": "portable",
"allowUnsafe": true
},
"dependencies": {
@ -26,7 +25,8 @@
"version": "1.0.0-*"
}
}
}
},
"net451": {}
},
"testRunner": "xunit"
}
Loading…
Cancel
Save