Skip to content

Commit

Permalink
(build) added opencover to build
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Aug 18, 2019
1 parent 5545551 commit dff984f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ build_script:
#---------------------------------#
# Tests
#---------------------------------#
test:
assemblies:
- '**\*.tests.dll'
test: off

#---------------------------------#
# Pull Requests #
Expand Down
28 changes: 25 additions & 3 deletions build/build.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.10.0"
#tool "nuget:?package=OpenCover&version=4.7.922"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
Expand Down Expand Up @@ -38,10 +39,31 @@ Task("Build")
.SetConfiguration(configuration)
.WithTarget("Build")
);


// test & coverage
var testAssemblies = GetFiles(srcDir + File($"**/bin/{configuration}/*.Tests.dll"));
var workDir = testAssemblies.First().GetDirectory();
NUnit3(testAssemblies);
var testOutput = binDir + File("TestResult.xml");
var coverOutput = binDir + File("CoverageResult.xml");
OpenCover(c =>
{
c.NUnit3(testAssemblies, new NUnit3Settings
{
Work = binDir,
OutputFile = testOutput
});
},
coverOutput,
new OpenCoverSettings()
.WithFilter("+[Cake.AsciiDoctorJ]*")
.WithFilter("-[Cake.AsciiDoctorJ.Tests]*")
);

// on AppVeyor, publish testsettings..
if(EnvironmentVariable("APPVEYOR_JOB_ID") != null)
{
Information("Running on appveyor. Publishing Test-Result.");
BuildSystem.AppVeyor.UploadTestResults(testOutput, AppVeyorTestResultsType.NUnit3);
}
});

Task("Dist")
Expand Down

0 comments on commit dff984f

Please sign in to comment.