From d52fe5aece22d5c53cfe7d7950e5be79f32cc8be Mon Sep 17 00:00:00 2001 From: dfederm Date: Mon, 1 Apr 2024 11:54:05 -0700 Subject: [PATCH] Release Microsoft.Build.RunVSTest --- README.md | 6 ++++ src/RunTests/README.md | 63 +++++++-------------------------------- src/RunTests/version.json | 2 +- 3 files changed, 18 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 7c31520..1653881 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Supports staging artifacts from build outputs. Enables Copy on Write for faster file copies. +### [Microsoft.Build.RunVSTest](src/RunTests) +[![NuGet](https://img.shields.io/nuget/v/Microsoft.Build.RunVSTest.svg)](https://www.nuget.org/packages/Microsoft.Build.RunVSTest) + [![NuGet](https://img.shields.io/nuget/dt/Microsoft.Build.RunVSTest.svg)](https://www.nuget.org/packages/Microsoft.Build.RunVSTest) + +Hooks VSTest to the Test target, allowing running tests concurrently with the build via `msbuild /t:Build;Test`. + ## How can I use these SDKs? When using an MSBuild Project SDK obtained via NuGet (such as the SDKs in this repo) a specific version **must** be specified. diff --git a/src/RunTests/README.md b/src/RunTests/README.md index e3d54d9..237765a 100644 --- a/src/RunTests/README.md +++ b/src/RunTests/README.md @@ -2,72 +2,31 @@ The `Microsoft.Build.RunVSTest` MSBuild SDK adds support for running tests from MSBuild, similarly to how one would use `dotnet test`. -## For projects that cannot use package references such as vcxproj. Usage in `Directory.Packages.Props` -In your global.json add the following: -```json -{ - "msbuild-sdks": { - "Microsoft.Build.RunVSTest": "1.0.0" - } -} -``` -In your ..vcxproj file -```xml - - - ... - -``` - -## For projects that use packages references. In your `Directory.Packages.props`: -```xml - -... - - - - -``` - -``` - - - - - -``` +## Usage -This example will include the `Microsoft.Build.RunVSTest` task for all NuGet-based projects in your repo. +In `Directory.Build.props`: -## Dirs.proj example -Use with traversal project -``` - - - - - - - - +```xml + ``` -## Sln -``` +Alternately, if all projects in the repo support packages references, in `Directory.Packages.props`: +```xml - + ``` -## Example -To run tests +Then to run tests: ``` msbuild /t:Test ``` -To build and run tests +Or build and run tests ``` msbuild /t:Build;Test ``` + +Note that running build and tests together in a single MSBuild invocatino can be significantly faster than building and then in serial running tests after. \ No newline at end of file diff --git a/src/RunTests/version.json b/src/RunTests/version.json index 991aada..5157e3f 100644 --- a/src/RunTests/version.json +++ b/src/RunTests/version.json @@ -1,4 +1,4 @@ { - "inherit": false, + "inherit": true, "version": "1.0" }