Removed misleading doc and added -vs testing (#32618)
authorMarie Píchová <mapichov@microsoft.com>
Fri, 21 Feb 2020 21:18:37 +0000 (22:18 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Feb 2020 21:18:37 +0000 (22:18 +0100)
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
docs/workflow/testing/libraries/testing-vs.md [deleted file]
docs/workflow/testing/libraries/testing.md

diff --git a/docs/workflow/testing/libraries/testing-vs.md b/docs/workflow/testing/libraries/testing-vs.md
deleted file mode 100644 (file)
index cfd3b21..0000000
+++ /dev/null
@@ -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.
index a332c9f..9baaa5f 100644 (file)
@@ -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.