From bce3689f65fa815190077065f5d3b8146fa469d4 Mon Sep 17 00:00:00 2001 From: Beatriz Del_Saz Date: Mon, 10 Sep 2018 21:32:28 +0200 Subject: [PATCH 1/4] edited documentation with note to powershell and VSTS users regarding multiple includes and excludes --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3a1e2c0a2..f717e7386 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,16 @@ Examples Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions. +Note for Powershell / VSTS users +To exclude or include multiple assemblies when using Powershell scripts or creating a .yaml file for a VSTS build ```%2c``` should be used as a separator. Msbuild will translate this symbol to ```,```. + +```/p:Exclude="[*]*Examples?%2c[*]*Startup"``` + +VSTS builds do not require double quotes to be unescaped: +``` +dotnet test --configuration $(buildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/ /p:Exclude="[MyAppName.DebugHost]*%2c[MyAppNamet.WebHost]*%2c[MyAppName.App]*" +``` + ### MSBuild In this mode, Coverlet doesn't require any additional setup other than including the NuGet package in the unit test project. It integrates with the `dotnet test` infrastructure built into the .NET Core CLI and when enabled, will automatically generate coverage results after tests are run. From 98d2ae8d2c857c424dd6eba637ad0ae3cfa0d654 Mon Sep 17 00:00:00 2001 From: Beatriz Del_Saz Date: Mon, 10 Sep 2018 21:34:06 +0200 Subject: [PATCH 2/4] updated docs --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f717e7386..d07d871e4 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ Examples Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions. Note for Powershell / VSTS users + To exclude or include multiple assemblies when using Powershell scripts or creating a .yaml file for a VSTS build ```%2c``` should be used as a separator. Msbuild will translate this symbol to ```,```. ```/p:Exclude="[*]*Examples?%2c[*]*Startup"``` From 550bd71e4b2b1ad43bd4a406d043b93390a58e6f Mon Sep 17 00:00:00 2001 From: Beatriz Del_Saz Date: Mon, 10 Sep 2018 21:34:40 +0200 Subject: [PATCH 3/4] updated docs --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d07d871e4..da549a14a 100644 --- a/README.md +++ b/README.md @@ -194,8 +194,7 @@ Examples Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions. -Note for Powershell / VSTS users - +##### Note for Powershell / VSTS users To exclude or include multiple assemblies when using Powershell scripts or creating a .yaml file for a VSTS build ```%2c``` should be used as a separator. Msbuild will translate this symbol to ```,```. ```/p:Exclude="[*]*Examples?%2c[*]*Startup"``` From 1472c69d47c09984388738aeb20b8d72f5b94905 Mon Sep 17 00:00:00 2001 From: Beatriz Del_Saz Date: Fri, 21 Sep 2018 15:44:09 +0200 Subject: [PATCH 4/4] updated order --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index da549a14a..faae7fa1d 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,12 @@ Examples Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions. +### MSBuild + +In this mode, Coverlet doesn't require any additional setup other than including the NuGet package in the unit test project. It integrates with the `dotnet test` infrastructure built into the .NET Core CLI and when enabled, will automatically generate coverage results after tests are run. + +If a property takes multiple comma-separated values please note that [you will have to add escaped quotes around the string](https://github.com/Microsoft/msbuild/issues/2999#issuecomment-366078677) like this: `/p:Exclude=\"[coverlet.*]*,[*]Coverlet.Core*\"`, `/p:Include=\"[coverlet.*]*,[*]Coverlet.Core*\"`, or `/p:CoverletOutputFormat=\"json,opencover\"`. + ##### Note for Powershell / VSTS users To exclude or include multiple assemblies when using Powershell scripts or creating a .yaml file for a VSTS build ```%2c``` should be used as a separator. Msbuild will translate this symbol to ```,```. @@ -204,12 +210,6 @@ VSTS builds do not require double quotes to be unescaped: dotnet test --configuration $(buildConfiguration) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/ /p:Exclude="[MyAppName.DebugHost]*%2c[MyAppNamet.WebHost]*%2c[MyAppName.App]*" ``` -### MSBuild - -In this mode, Coverlet doesn't require any additional setup other than including the NuGet package in the unit test project. It integrates with the `dotnet test` infrastructure built into the .NET Core CLI and when enabled, will automatically generate coverage results after tests are run. - -If a property takes multiple comma-separated values please note that [you will have to add escaped quotes around the string](https://github.com/Microsoft/msbuild/issues/2999#issuecomment-366078677) like this: `/p:Exclude=\"[coverlet.*]*,[*]Coverlet.Core*\"`, `/p:Include=\"[coverlet.*]*,[*]Coverlet.Core*\"`, or `/p:CoverletOutputFormat=\"json,opencover\"`. - #### Code Coverage Enabling code coverage is as simple as setting the `CollectCoverage` property to `true`