From 2d0249eb2ca19a1870fea0b627e565caa352dc02 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 24 Feb 2021 20:25:10 +0100 Subject: [PATCH 1/5] Update testing docs with x86 instructions --- docs/workflow/testing/libraries/testing.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index 9ab30e12be41ad..68a5a316ccaded 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -15,6 +15,11 @@ build.cmd/sh -subset libs.tests build.cmd/sh -subset libs.tests -test -c Release ``` +- The following builds all tests for x86 architecture (**for x86 it's mandatory to build clr** even if you want to run libs tests only): +``` +build.cmd/sh -subset clr+libs.pretest -rc Release -arch x86 +``` + - The following example shows how to pass extra msbuild properties to ignore tests ignored in CI: ``` build.cmd/sh -subset libs.tests -test /p:WithoutCategories=IgnoreForCI @@ -41,6 +46,11 @@ It is possible to pass parameters to the underlying xunit runner via the `XUnitO dotnet build /t:Test /p:XUnitOptions="-class Test.ClassUnderTests" ``` +Which is very useful when you want to run tests as `x86` on a `x64` machine: +```cmd +dotnet build /t:Test /p:TargetArchitecture=x86 +``` + There may be multiple projects in some directories so you may need to specify the path to a specific test project to get it to build and run the tests. #### Running a single test on the command line From 236e9f8c92cc7b6f75426377535aebdfbfad6688 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 23 Mar 2021 16:12:52 +0100 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Santiago Fernandez Madero --- docs/workflow/testing/libraries/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index 68a5a316ccaded..09df12b6dd55ef 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -15,7 +15,7 @@ build.cmd/sh -subset libs.tests build.cmd/sh -subset libs.tests -test -c Release ``` -- The following builds all tests for x86 architecture (**for x86 it's mandatory to build clr** even if you want to run libs tests only): +- The following builds all tests for x86 architecture (**for any architecture it's mandatory to build a runtime (coreclr or mono)** even if you want to run libs tests only): ``` build.cmd/sh -subset clr+libs.pretest -rc Release -arch x86 ``` From 038d88520226774d9319bc282b799199b44c0283 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 23 Mar 2021 16:30:58 +0100 Subject: [PATCH 3/5] add more examples --- docs/workflow/testing/libraries/testing.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index 09df12b6dd55ef..aa77f72b0b2f7f 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -2,7 +2,7 @@ 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. +To build the tests and run them you can call the libraries build script. **For every architecture it's mandatory to build a runtime (clr or mono)** even if you want to run libs tests only. **Examples** - The following shows how to build only the tests but not run them: @@ -10,14 +10,29 @@ To build the tests and run them you can call the libraries build script. build.cmd/sh -subset libs.tests ``` +- The following builds and runs all tests using clr: +``` +build.cmd/sh -subset clr+libs.tests -test +``` + +- The following builds and runs all tests using mono: +``` +build.cmd/sh -subset mono+libs.tests -test +``` + - The following builds and runs all tests in release configuration: ``` build.cmd/sh -subset libs.tests -test -c Release ``` -- The following builds all tests for x86 architecture (**for any architecture it's mandatory to build a runtime (coreclr or mono)** even if you want to run libs tests only): +- The following builds clr in release, libs in debug and runs all tests: +``` +build.cmd/sh -subset clr+libs.tests -test -rc Release +``` + +- The following builds mono and libs for x86 architecture and runs all tests: ``` -build.cmd/sh -subset clr+libs.pretest -rc Release -arch x86 +build.cmd/sh -subset mono+libs.tests -test -arch x86 ``` - The following example shows how to pass extra msbuild properties to ignore tests ignored in CI: From 14a5bd00ead61005ac37795acc02f23d6376db45 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Tue, 23 Mar 2021 19:09:09 +0100 Subject: [PATCH 4/5] Apply suggestions from code review Co-authored-by: Dan Moseley --- docs/workflow/testing/libraries/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index aa77f72b0b2f7f..6d59c0b4d95565 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -2,7 +2,7 @@ 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. **For every architecture it's mandatory to build a runtime (clr or mono)** even if you want to run libs tests only. +To build the tests and run them you can call the libraries build script. For libraries tests to work, you must have built the coreclr or mono runtime for them to run on. **Examples** - The following shows how to build only the tests but not run them: @@ -32,7 +32,7 @@ build.cmd/sh -subset clr+libs.tests -test -rc Release - The following builds mono and libs for x86 architecture and runs all tests: ``` -build.cmd/sh -subset mono+libs.tests -test -arch x86 +build.cmd/sh -subset mono+libs+libs.tests -test -arch x86 ``` - The following example shows how to pass extra msbuild properties to ignore tests ignored in CI: From f6f19bcbb53a62e45df3a85920d03dd4c662c9c7 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Mon, 24 May 2021 11:42:31 -0700 Subject: [PATCH 5/5] Update docs/workflow/testing/libraries/testing.md Co-authored-by: Santiago Fernandez Madero --- docs/workflow/testing/libraries/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/libraries/testing.md b/docs/workflow/testing/libraries/testing.md index 6d59c0b4d95565..3575cce34b1e96 100644 --- a/docs/workflow/testing/libraries/testing.md +++ b/docs/workflow/testing/libraries/testing.md @@ -27,7 +27,7 @@ build.cmd/sh -subset libs.tests -test -c Release - The following builds clr in release, libs in debug and runs all tests: ``` -build.cmd/sh -subset clr+libs.tests -test -rc Release +build.cmd/sh -subset clr+libs+libs.tests -test -rc Release ``` - The following builds mono and libs for x86 architecture and runs all tests: