Skip to content

Commit 5644aeb

Browse files
authored
Merge pull request #18 from sharwell/codecov
Wrap the xunit execution in OpenCover and report results to codecov.io
2 parents 98616a7 + 307000d commit 5644aeb

File tree

7 files changed

+72
-12
lines changed

7 files changed

+72
-12
lines changed

Directory.Build.props

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
</PropertyGroup>
1111

1212
<PropertyGroup>
13+
<!--
14+
No special considerations are needed for portable PDBs since this repository doesn't publish or ship any symbol
15+
files.
16+
-->
1317
<DebugSymbols>true</DebugSymbols>
14-
<DebugType>portable</DebugType>
18+
<DebugType>full</DebugType>
1519
</PropertyGroup>
1620

1721
<PropertyGroup>
@@ -23,6 +27,11 @@
2327
<None Include="$(AssemblyOriginatorKeyFile)" Condition="'$(AssemblyOriginatorKeyFile)' != ''" Link="%(Filename)%(Extension)" />
2428
</ItemGroup>
2529

30+
<ItemGroup>
31+
<PackageReference Include="Codecov" Version="1.0.3" IncludeAssets="none" PrivateAssets="all" />
32+
<PackageReference Include="OpenCover" Version="4.6.519" IncludeAssets="none" PrivateAssets="all" />
33+
</ItemGroup>
34+
2635
<!-- StyleCop Analyzers configuration -->
2736
<PropertyGroup>
2837
<GenerateDocumentationFile>true</GenerateDocumentationFile>

MouseFastScroll.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7939456F-2CC6-4242-96AB-E1C8D75C0D79}"
77
ProjectSection(SolutionItems) = preProject
88
appveyor.yml = appveyor.yml
9+
codecov.yml = codecov.yml
910
Directory.Build.props = Directory.Build.props
1011
Directory.Build.targets = Directory.Build.targets
1112
LICENSE.txt = LICENSE.txt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Mouse Fast Scroll extension for Visual Studio 2012+
22

33
[![Build status](https://ci.appveyor.com/api/projects/status/bxcpp55od7oo11si/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/mousefastscroll/branch/master)
4+
[![codecov.io](http://codecov.io/gh/tunnelvisionlabs/MouseFastScroll/coverage.svg?branch=master)](http://codecov.io/gh/tunnelvisionlabs/MouseFastScroll?branch=master)
45

56
This extension performs two tasks that I simply can't live without:
67

Tvl.VisualStudio.MouseFastScroll.IntegrationTestService/Tvl.VisualStudio.MouseFastScroll.IntegrationTestService.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
1515
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
1616
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
17-
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
17+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">

Tvl.VisualStudio.MouseFastScroll/Tvl.VisualStudio.MouseFastScroll.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
1515
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
1616
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
17-
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
17+
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">

appveyor.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,39 @@ install:
1111
- '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit'
1212
build:
1313
verbosity: minimal
14-
test:
15-
assemblies:
16-
only:
17-
- '**\*.UnitTests.dll'
18-
- '**\*.IntegrationTests.dll'
19-
categories:
20-
except:
21-
- VS2012
22-
- VS2013
14+
test_script:
15+
- ps: |
16+
$unitTestAssembly = "Tvl.VisualStudio.MouseFastScroll.UnitTests\bin\$env:CONFIGURATION\net452\Tvl.VisualStudio.MouseFastScroll.UnitTests.dll"
17+
$integrationTestAssembly = "Tvl.VisualStudio.MouseFastScroll.IntegrationTests\bin\x86\$env:CONFIGURATION\net452\Tvl.VisualStudio.MouseFastScroll.IntegrationTests.dll"
18+
$buildProperties = [xml](Get-Content Directory.Build.props)
19+
$openCoverVersion = $buildProperties.SelectSingleNode('/Project/ItemGroup/PackageReference[@Include="OpenCover"]').Version
20+
$openCoverConsole = Join-Path (Join-Path $env:UserProfile '.nuget\packages\') "opencover\$openCoverVersion\tools\OpenCover.Console.exe"
21+
$codecovVersion = $buildProperties.SelectSingleNode('/Project/ItemGroup/PackageReference[@Include="Codecov"]').Version
22+
$codecov = Join-Path (Join-Path $env:UserProfile '.nuget\packages\') "codecov\$codecovVersion\tools\codecov.exe"
23+
&$openCoverConsole `
24+
-register:user `
25+
-returntargetcode `
26+
-hideskipped:All `
27+
-filter:"+[Tvl*]*" `
28+
-excludebyattribute:*.ExcludeFromCodeCoverage* `
29+
-excludebyfile:*\*Designer.cs `
30+
-output:OpenCover.MouseFastScroll.UnitTests.xml `
31+
-target:"$env:xunit20\xunit.console.x86.exe" `
32+
-targetargs:"$unitTestAssembly -appveyor -noshadow"
33+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
34+
&$openCoverConsole `
35+
-register:user `
36+
-returntargetcode `
37+
-hideskipped:All `
38+
-filter:"+[Tvl*]*" `
39+
-excludebyattribute:*.ExcludeFromCodeCoverage* `
40+
-excludebyfile:*\*Designer.cs `
41+
-searchdirs:"Tvl.VisualStudio.MouseFastScroll.UnitTests\bin\$env:CONFIGURATION\net452;Tvl.VisualStudio.MouseFastScroll.IntegrationTestService\bin\$env:CONFIGURATION\net45" `
42+
-output:OpenCover.MouseFastScroll.IntegrationTests.xml `
43+
-target:"$env:xunit20\xunit.console.x86.exe" `
44+
-targetargs:"$integrationTestAssembly -appveyor -noshadow -notrait Category=VS2012 -notrait Category=VS2013"
45+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
46+
&$codecov -f OpenCover.MouseFastScroll.UnitTests.xml --flag unit
47+
&$codecov -f OpenCover.MouseFastScroll.IntegrationTests.xml --flag integration
2348
artifacts:
2449
- path: 'Tvl.VisualStudio.MouseFastScroll\**\*.vsix'

codecov.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# https://docs.codecov.io/docs/codecov-yaml
2+
# https://github.com/codecov/support/wiki/Codecov-Yaml
3+
4+
coverage:
5+
status:
6+
project:
7+
default: false
8+
patch:
9+
default: false
10+
11+
comment:
12+
layout: "diff, flags, files, footer"
13+
14+
flags:
15+
production:
16+
auto_apply: true
17+
paths:
18+
- Tvl.VisualStudio.MouseFastScroll/
19+
test:
20+
auto_apply: true
21+
paths:
22+
- Tvl.VisualStudio.MouseFastScroll.IntegrationTests/
23+
- Tvl.VisualStudio.MouseFastScroll.IntegrationTestService/
24+
- Tvl.VisualStudio.MouseFastScroll.UnitTests/

0 commit comments

Comments
 (0)