mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 02:13:38 +09:00
Removed misleading doc and added -vs testing (#32618)
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
This commit is contained in:
parent
9981b1f128
commit
12f1f58ec0
2 changed files with 10 additions and 22 deletions
|
@ -1,22 +0,0 @@
|
|||
# Running unit tests within Visual Studio
|
||||
|
||||
Sometimes it is convenient to run individual unit tests within the Visual Studio
|
||||
IDE. First, build the repo from the command line to create artifacts and set up
|
||||
the test environment. Then, use VS Test Explorer to run and debug tests.
|
||||
|
||||
## Steps
|
||||
|
||||
1. `build.cmd -test`
|
||||
2. Open the solution file in the root of the repo.
|
||||
3. Open the test explorer window within the Visual Studio IDE.
|
||||
4. Select tests and run and/or debug.
|
||||
|
||||
## Limitations
|
||||
|
||||
* The managed projects load and build, but native and setup projects are not
|
||||
present in the solution and there's no way to trigger a build from inside VS.
|
||||
* Rebuilding the native assets alone won't make them used during tests. The
|
||||
tests rely on the setup projects to assemble the native bits into a usable
|
||||
form, and they have to be rebuilt.
|
||||
* With a deep enough understanding of the test layout, you can work around
|
||||
this by copying native build outputs directly into the test layout.
|
|
@ -53,3 +53,13 @@ Each test project can potentially have multiple target frameworks. There are som
|
|||
```cmd
|
||||
dotnet build src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj /p:BuildTargetFramework=net472
|
||||
```
|
||||
|
||||
## Running tests from Visual Studio
|
||||
|
||||
**Test Explorer** will be able to discover the tests only if the solution is opened with `build -vs` command, e.g.:
|
||||
```cmd
|
||||
build -vs System.Net.Http
|
||||
```
|
||||
If running the tests from **Test Explorer** does nothing, it probably tries to use x86 dotnet installation instead of the x64 one. It can be fixed by setting the x64 architecture manually in the test settings.
|
||||
|
||||
It is also possible to execute the tests by simply debugging the test project once it's been built. It will underneath call the same command as `dotnet build /t:Test` does.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue