Skip to content

Commit 5ddb175

Browse files
author
Oren Novotny
committed
Use coverlet code coverage
1 parent 4a2d530 commit 5ddb175

File tree

5 files changed

+29
-30
lines changed

5 files changed

+29
-30
lines changed

CodeCoverage.runsettings

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,15 @@
22
<!-- File name extension must be .runsettings -->
33
<RunSettings>
44
<DataCollectionRunSettings>
5-
<DataCollectors>
6-
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
5+
<DataCollectors>
6+
<DataCollector friendlyName="XPlat code coverage">
77
<Configuration>
8-
<CodeCoverage>
9-
10-
<!--
11-
About include/exclude lists:
12-
Empty "Include" clauses imply all; empty "Exclude" clauses imply none.
13-
Each element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx.
14-
An item must first match at least one entry in the include list to be included.
15-
Included items must then not match any entries in the exclude list to remain included.
16-
-->
17-
18-
<!-- Match assembly file paths: -->
19-
<ModulePaths>
20-
<Include>
21-
<ModulePath>.*Crypto.*</ModulePath>
22-
</Include>
23-
<Exclude>
24-
<ModulePath>.*Test.dll$</ModulePath>
25-
<ModulePath>.*nunit.*</ModulePath>
26-
</Exclude>
27-
</ModulePaths>
28-
29-
</CodeCoverage>
8+
<Format>cobertura</Format>
9+
<Exclude>[xunit.*]*,[*Tests]*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
10+
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
11+
<SingleHit>false</SingleHit>
3012
</Configuration>
31-
</DataCollector>
13+
</DataCollector>
3214
</DataCollectors>
3315
</DataCollectionRunSettings>
34-
</RunSettings>
16+
</RunSettings>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Portable.BouncyCastle
22
================
33

4-
BouncyCastle portable version with support for .NET 4, .NET Standard 1.0-2.0, WP, Silverlight, MonoAndroid, Xamarin.iOS, .NET Core
4+
BouncyCastle portable version with support for .NET 4, .NET Standard 2.0, MonoAndroid, Xamarin.iOS, .NET Core
55

66
================
77

azure-pipelines.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ variables:
1616
steps:
1717
- task: DotNetCoreInstaller@0
1818
inputs:
19-
version: '3.0.100-preview5-011568'
19+
version: '3.0.100-preview7-012821'
2020

2121
- task: DotNetCoreCLI@2
2222
inputs:
@@ -36,13 +36,29 @@ steps:
3636
configuration: $(BuildConfiguration)
3737
arguments: /p:PackageId="Portable.BouncyCastle"
3838
displayName: Build
39+
40+
- task: DotNetCoreCLI@2
41+
inputs:
42+
command: custom
43+
custom: tool
44+
arguments: install --tool-path . dotnet-reportgenerator-globaltool
45+
displayName: Install ReportGenerator tool
3946

4047
- task: DotNetCoreCLI@2
4148
inputs:
4249
command: test
4350
projects: .\crypto\test\crypto.test.csproj
44-
arguments: -c $(BuildConfiguration) --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)\CodeCoverage.runsettings /p:DebugType=portable
51+
arguments: -c $(BuildConfiguration) --collect:"XPlat Code Coverage" -s $(System.DefaultWorkingDirectory)\CodeCoverage.runsettings
4552
displayName: Run Tests
53+
54+
- script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/reports -reporttypes:"Cobertura"
55+
displayName: Create reports
56+
57+
- task: PublishCodeCoverageResults@1
58+
displayName: 'Publish code coverage'
59+
inputs:
60+
codeCoverageTool: Cobertura
61+
summaryFileLocation: $(Build.SourcesDirectory)/reports/Cobertura.xml
4662

4763
- task: PowerShell@2
4864
displayName: Authenticode Sign artifacts

crypto/test/crypto.test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
1616
<PackageReference Include="NUnit" Version="3.12.0" />
1717
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
18+
<PackageReference Include="coverlet.collector" Version="1.0.1" />
1819
</ItemGroup>
1920
<ItemGroup>
2021
<ProjectReference Include="..\src\crypto.csproj" />

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.8.5.1",
2+
"version": "1.8.5.2",
33
"publicReleaseRefSpec": [
44
"^refs/heads/master$", // we release out of master
55
"^refs/heads/netstandard$", // we release out of netstandard

0 commit comments

Comments
 (0)