mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 11:37:04 +09:00
Add how to run outer loop libraries tests (#32940)
* Add how to run outer loop libraries tests
This commit is contained in:
parent
c5cbfee634
commit
cee4eca178
1 changed files with 12 additions and 6 deletions
|
@ -5,17 +5,17 @@ We use the OSS testing framework [xunit](http://xunit.github.io/).
|
|||
To build the tests and run them you can call the libraries build script.
|
||||
|
||||
**Examples**
|
||||
- The following shows how to build only the tests but not run them
|
||||
- The following shows how to build only the tests but not run them:
|
||||
```
|
||||
libraries -buildtests
|
||||
```
|
||||
|
||||
- The following builds and runs all tests for .NET Core in release configuration.
|
||||
- The following builds and runs all tests for .NET Core in release configuration:
|
||||
```
|
||||
libraries -test -c Release
|
||||
```
|
||||
|
||||
- The following example shows how to pass extra msbuild properties to ignore tests ignored in CI.
|
||||
- The following example shows how to pass extra msbuild properties to ignore tests ignored in CI:
|
||||
```
|
||||
libraries -test /p:WithoutCategories=IgnoreForCI
|
||||
```
|
||||
|
@ -28,12 +28,11 @@ libraries -test /p:TestNoBuild=true
|
|||
|
||||
## Running tests on the command line
|
||||
|
||||
To build tests you need to pass the `-buildtests` flag to build.cmd/sh or if you want to build both src and tests you pass `-buildtests` flag (`libraries -restore -build -buildtests`). Note that you need to specify -restore and -build additionally as those are only implicit if no action is passed in.
|
||||
To build tests you need to pass the `-buildtests` flag to `build.cmd/sh` or run `libraries -restore -build -buildtests` (note that you need to specify `-restore` and `-build` additionally as those are only implicit if no action is passed in).
|
||||
|
||||
If you are interested in building and running the tests only for a specific library, then there are two different ways to do it:
|
||||
|
||||
The easiest (and recommended) way to build and run the tests for a specific library, is to invoke the `Test` target on that library:
|
||||
|
||||
```cmd
|
||||
cd src\libraries\System.Collections.Immutable\tests
|
||||
dotnet build /t:Test
|
||||
|
@ -53,9 +52,16 @@ To quickly run or debug a single test from the command line, set the XunitMethod
|
|||
dotnet build /t:Test /p:XunitMethodName={FullyQualifiedNamespace}.{ClassName}.{MethodName}
|
||||
```
|
||||
|
||||
#### Running outer loop tests
|
||||
|
||||
To run all tests, including "outer loop" tests (which are typically slower and in some test suites less reliable, but which are more comprehensive):
|
||||
```cmd
|
||||
dotnet build /t:Test /p:Outerloop=true
|
||||
```
|
||||
|
||||
#### Running tests on a different target framework
|
||||
|
||||
Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. By default we will build and run only the default build target framework which is `netcoreapp5.0`. The rest of the targetframeworks will need to be built and ran by specifying the BuildTargetFramework option.
|
||||
Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. By default we will build and run only the default build target framework which is `netcoreapp5.0`. The rest of the `TargetFrameworks` will need to be built and ran by specifying the `BuildTargetFramework` option, e.g.:
|
||||
```cmd
|
||||
dotnet build src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj /p:BuildTargetFramework=net472
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue