From: Marie Píchová Date: Fri, 21 Feb 2020 21:18:37 +0000 (+0100) Subject: Removed misleading doc and added -vs testing (#32618) X-Git-Tag: submit/tizen/20210909.063632~9561 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12f1f58ec06be6d1ca8ab42d4249e8b0fa9ab4f9;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Removed misleading doc and added -vs testing (#32618) Co-authored-by: Viktor Hofer --- diff --git a/docs/workflow/testing/libraries/testing-vs.md b/docs/workflow/testing/libraries/testing-vs.md deleted file mode 100644 index cfd3b21..0000000 --- a/docs/workflow/testing/libraries/testing-vs.md +++ /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. diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index a332c9f..9baaa5f 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -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.