From 51241f1242303c90f9041cc2164644b91993d336 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:45:54 -0500 Subject: [PATCH 01/23] Update testing.md --- docs/workflow/testing/mono/testing.md | 50 +++++++++------------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 1bffa1de3389b..7dbcce0fb0684 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -1,54 +1,38 @@ # Running Tests using Mono Runtime -## Running Runtime Tests -We currently only support running tests against coreclr. There are additional mono runtime tests in mono/mono, but they -have not been moved over yet. Simply run the following command: - -``` -dotnet build /t:RunCoreClrTests $(REPO_ROOT)/src/mono/mono.proj -``` +Before running any tests, build mono in the way that you would like to test with. +See the instructions for [Building Mono](../../building/mono/README.md) -If you want to run individual tests, execute this command: +## Running Runtime Tests -``` -dotnet build /t:RunCoreClrTest /p:CoreClrTest="" $(REPO_ROOT)/src/mono/mono.proj -``` +See the instructions for [Running runtime tests with Mono](../coreclr/testing-mono.md) Plus, there are additional mono runtime tests in mono/mono, but they +have not been moved over yet. ## Running Library Tests Running library tests against Mono is straightforward regardless of configuration. Simply run the following commands: -1. Build and set the RuntimeFlavor +1. cd into the test library of your choice (`cd src/libraries//tests`) + +2. Run the tests -```bash -./build.sh /p:RuntimeFlavor=mono ``` -or on Windows -```bat -build.cmd /p:RuntimeFlavor=mono +dotnet build /t:Test /p:RuntimeFlavor=mono /p:Configuration= ``` -2. cd into the test library of your choice (`cd src/libraries//tests`) - -3. Run the tests +# Test with sample program +There is a HelloWorld sample program lives at ``` -dotnet build /t:Test /p:RuntimeFlavor=mono +$(REPO_ROOT)/src/mono/netcore/sample/HelloWorld ``` -# Patching Local dotnet (.dotnet-mono) -Another way to test mono out is by 'patching' a local dotnet with our runtime bits. This is a good way to write simple -test programs and get a glimpse of how mono will work with the dotnet tooling. +This is a good way to write simple test programs and get a glimpse of how mono will work with the dotnet tooling. -To generate a local .dotnet-mono, execute this command: +To run that program, you could simply cd to that directory and execute ``` -dotnet build /t:PatchLocalMonoDotnet $(REPO_ROOT)/src/mono/mono.proj +make run ``` -You can then, for example, run our HelloWorld sample via: - -``` -dotnet build -c Release $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld -MONO_ENV_OPTIONS="" COMPlus_DebugWriteToStdErr=1 \ -$(REPO_ROOT)/.dotnet-mono/dotnet $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld/bin/HelloWorld.dll -``` +Note that, it is configured with run with Release and LLVM mode by default. If you would like to work with other modes, +you could edit the Makefile from that folder. From 5afb1dac109db5ae72c088fa025565804a1fdc8a Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:39:53 -0500 Subject: [PATCH 02/23] Create testing-mono.md --- docs/workflow/testing/coreclr/testing-mono.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/workflow/testing/coreclr/testing-mono.md diff --git a/docs/workflow/testing/coreclr/testing-mono.md b/docs/workflow/testing/coreclr/testing-mono.md new file mode 100644 index 0000000000000..2dacfe80e6326 --- /dev/null +++ b/docs/workflow/testing/coreclr/testing-mono.md @@ -0,0 +1,46 @@ +# Running Runtime Tests using Mono Runtime + +## Build mono +Before running any tests, build mono in the way that you would like to test with. +See the instructions for [Building Mono](../../building/mono/README.md) + +## Build and Run Runtime Tests +* Build and run one specific Runtime Test for JIT. From the root directory run the following command: +``` +cd src/mono/netcore +make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" +``` + +* Build and run all Runtime Tests for JIT. From the root directory run the following command: +``` +cd src/mono/netcore +make run-tests-coreclr-all +``` + +* Build and run Runtime Tests for Webassembly. From the root directory run the following command: +``` +src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm +``` +From the last few lines of the build log, you will see something like this +``` +-------------------------------------------------- + Example run.sh command + + src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release +-------------------------------------------------- +``` +To run the tests, copy that command and add `wasm` at the end. + +* Build and run Runtime Tests for Android x64. From the root directory run the following command: +``` +src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 +``` +From the last few lines of the build log, you will see something like this +``` +-------------------------------------------------- + Example run.sh command + + src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release +-------------------------------------------------- +``` +To run the tests, copy that command and add `Android` at the end. From 6a6d4214f3499a57cc52bb9c9e7d2cf648fe9ec9 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 6 Nov 2020 17:28:56 -0500 Subject: [PATCH 03/23] Update mono testing doc --- docs/workflow/testing/coreclr/testing-mono.md | 46 ---------------- docs/workflow/testing/mono/testing.md | 55 +++++++++++++++++-- 2 files changed, 50 insertions(+), 51 deletions(-) delete mode 100644 docs/workflow/testing/coreclr/testing-mono.md diff --git a/docs/workflow/testing/coreclr/testing-mono.md b/docs/workflow/testing/coreclr/testing-mono.md deleted file mode 100644 index 2dacfe80e6326..0000000000000 --- a/docs/workflow/testing/coreclr/testing-mono.md +++ /dev/null @@ -1,46 +0,0 @@ -# Running Runtime Tests using Mono Runtime - -## Build mono -Before running any tests, build mono in the way that you would like to test with. -See the instructions for [Building Mono](../../building/mono/README.md) - -## Build and Run Runtime Tests -* Build and run one specific Runtime Test for JIT. From the root directory run the following command: -``` -cd src/mono/netcore -make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" -``` - -* Build and run all Runtime Tests for JIT. From the root directory run the following command: -``` -cd src/mono/netcore -make run-tests-coreclr-all -``` - -* Build and run Runtime Tests for Webassembly. From the root directory run the following command: -``` -src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm -``` -From the last few lines of the build log, you will see something like this -``` --------------------------------------------------- - Example run.sh command - - src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release --------------------------------------------------- -``` -To run the tests, copy that command and add `wasm` at the end. - -* Build and run Runtime Tests for Android x64. From the root directory run the following command: -``` -src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 -``` -From the last few lines of the build log, you will see something like this -``` --------------------------------------------------- - Example run.sh command - - src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release --------------------------------------------------- -``` -To run the tests, copy that command and add `Android` at the end. diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 7dbcce0fb0684..fce56ec625b8d 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -4,12 +4,52 @@ Before running any tests, build mono in the way that you would like to test with See the instructions for [Building Mono](../../building/mono/README.md) ## Running Runtime Tests +* Build and run runtime tests against Mono JIT: -See the instructions for [Running runtime tests with Mono](../coreclr/testing-mono.md) Plus, there are additional mono runtime tests in mono/mono, but they -have not been moved over yet. + * Build and run one specific runtime test. From the root directory run the following command: +``` +cd src/mono/netcore +make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" +``` + + * Build and run all runtime tests. From the root directory run the following command: +``` +cd src/mono/netcore +make run-tests-coreclr-all +``` + +* Build and run runtime tests for Webassembly. From the root directory run the following command: +``` +src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm +``` + * From the last few lines of the build log, you will see something like this +``` +-------------------------------------------------- + Example run.sh command + + src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release +-------------------------------------------------- +``` + * To run the tests, copy that command and add `wasm` at the end. + +* Build and run Runtime Tests for Android x64. From the root directory run the following command: +``` +src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 +``` + * From the last few lines of the build log, you will see something like this +``` +-------------------------------------------------- + Example run.sh command + + src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release +-------------------------------------------------- +``` + * To run the tests, copy that command and add `Android` at the end. + +* For more details about the nature of the runtime tests, please refer to [Coreclr testing documents](../coreclr) ## Running Library Tests -Running library tests against Mono is straightforward regardless of configuration. Simply run the following commands: +* Build and run library tests against Mono JIT: 1. cd into the test library of your choice (`cd src/libraries//tests`) @@ -19,9 +59,14 @@ Running library tests against Mono is straightforward regardless of configuratio dotnet build /t:Test /p:RuntimeFlavor=mono /p:Configuration= ``` +* Build and run library tests against Webassembly. See instructions for [Testing Webassembly](../libraries/testing-wasm.md) + +* Build and run library tests against Android. See instructions for [Testing Android](../libraries/testing-android.md) + +* Build and run library tests against iOS. See instructions for [Testing iOS](../libraries/testing-apple.md) + # Test with sample program There is a HelloWorld sample program lives at - ``` $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld ``` @@ -34,5 +79,5 @@ To run that program, you could simply cd to that directory and execute make run ``` -Note that, it is configured with run with Release and LLVM mode by default. If you would like to work with other modes, +Note that, it is configured with run with `Release` and `LLVM` mode by default. If you would like to work with other modes, you could edit the Makefile from that folder. From 5ebf8afcc49c6b8c6d1ff7400b0af1b4db8a5a97 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 08:56:49 -0500 Subject: [PATCH 04/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index fce56ec625b8d..80d0eddcbd20b 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -1,7 +1,6 @@ # Running Tests using Mono Runtime -Before running any tests, build mono in the way that you would like to test with. -See the instructions for [Building Mono](../../building/mono/README.md) +Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. ## Running Runtime Tests * Build and run runtime tests against Mono JIT: From 8f386609d43d973081ae690991900af64758fa29 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:02:07 -0500 Subject: [PATCH 05/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 80d0eddcbd20b..e9efabfbb648c 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -17,7 +17,7 @@ cd src/mono/netcore make run-tests-coreclr-all ``` -* Build and run runtime tests for Webassembly. From the root directory run the following command: +### Testing on WebAssembly: ``` src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm ``` From 4dcfce535e7d2611aa2c08b61b0eed2f205887e9 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:02:36 -0500 Subject: [PATCH 06/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index e9efabfbb648c..0f4e530dc9d08 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -21,7 +21,8 @@ make run-tests-coreclr-all ``` src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm ``` - * From the last few lines of the build log, you will see something like this + +The last few lines of the build log should contain something like this: ``` -------------------------------------------------- Example run.sh command From 94d1c9091db2e57ad8a47944c5b8f90da216bfc3 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:02:58 -0500 Subject: [PATCH 07/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 0f4e530dc9d08..3648c3bf154f7 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -30,7 +30,8 @@ The last few lines of the build log should contain something like this: src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release -------------------------------------------------- ``` - * To run the tests, copy that command and add `wasm` at the end. + +Run that command, adding `wasm` to the end. * Build and run Runtime Tests for Android x64. From the root directory run the following command: ``` From 5d0fd911b362c747bc020aeea72d45989503a851 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:03:48 -0500 Subject: [PATCH 08/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 3648c3bf154f7..2d558615c7544 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -47,7 +47,7 @@ src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 < ``` * To run the tests, copy that command and add `Android` at the end. -* For more details about the nature of the runtime tests, please refer to [Coreclr testing documents](../coreclr) +For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) ## Running Library Tests * Build and run library tests against Mono JIT: From 0c664e8e9f53b3f4c552534e20210e9db6d3ad6b Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:05:01 -0500 Subject: [PATCH 09/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 2d558615c7544..be5bddf2475ee 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -1,4 +1,4 @@ -# Running Tests using Mono Runtime +# Running test suites using Mono Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. From 031a857613d3dc524c27a9f0aaa665ddf8862d4a Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:05:19 -0500 Subject: [PATCH 10/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index be5bddf2475ee..568aaa037b00f 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -2,7 +2,7 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. -## Running Runtime Tests +## Runtime Tests * Build and run runtime tests against Mono JIT: * Build and run one specific runtime test. From the root directory run the following command: From 4309c232cb2f3d1d04392431546c41e552ee5367 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:05:28 -0500 Subject: [PATCH 11/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 568aaa037b00f..1cf588b87588b 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -49,7 +49,7 @@ src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 < For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) -## Running Library Tests +## Libraries tests * Build and run library tests against Mono JIT: 1. cd into the test library of your choice (`cd src/libraries//tests`) From ae3b8bb3af9957a1423d11aa9b0fce57619c3f7e Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Wed, 11 Nov 2020 09:05:40 -0500 Subject: [PATCH 12/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 1cf588b87588b..6b0d10e1d8bcd 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -66,7 +66,7 @@ dotnet build /t:Test /p:RuntimeFlavor=mono /p:Configuration= * Build and run library tests against iOS. See instructions for [Testing iOS](../libraries/testing-apple.md) -# Test with sample program +# Running the Mono samples There is a HelloWorld sample program lives at ``` $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld From c538bd209d8bbb3d5155beca8b82889f70705745 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Wed, 11 Nov 2020 10:29:30 -0500 Subject: [PATCH 13/23] PR feedback --- docs/workflow/testing/mono/testing.md | 75 +++++++++++++++++++-------- 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 6b0d10e1d8bcd..a31b29f874950 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -3,23 +3,27 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. ## Runtime Tests -* Build and run runtime tests against Mono JIT: +### Testing against Mono JIT: - * Build and run one specific runtime test. From the root directory run the following command: + * Build runtime tests by executing the follwiing command from `$(REPO_ROOT)/src/tests` ``` -cd src/mono/netcore +./build.sh excludemonofailures +``` + * Running a single test: +``` +cd ../mono/netcore make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" ``` - * Build and run all runtime tests. From the root directory run the following command: + * Running all runtime tests: ``` -cd src/mono/netcore +cd ../mono/netcore make run-tests-coreclr-all ``` ### Testing on WebAssembly: ``` -src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm +$(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm ``` The last few lines of the build log should contain something like this: @@ -33,46 +37,74 @@ The last few lines of the build log should contain something like this: Run that command, adding `wasm` to the end. -* Build and run Runtime Tests for Android x64. From the root directory run the following command: +### Testing on Android x64: ``` -src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 +$(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 ``` - * From the last few lines of the build log, you will see something like this + +The last few lines of the build log should contain something like this: ``` -------------------------------------------------- Example run.sh command - src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release + src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Android.x64.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Android.x64.Release/tests --testRootDir=/artifacts/tests/coreclr/Android.x64.Release --copyNativeTestBin Release -------------------------------------------------- ``` - * To run the tests, copy that command and add `Android` at the end. +Run that command, adding `Android` at the end. For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) ## Libraries tests * Build and run library tests against Mono JIT: -1. cd into the test library of your choice (`cd src/libraries//tests`) +1. cd into the test library of your choice (`cd $(REPO_ROOT)/src/libraries//tests`) 2. Run the tests ``` -dotnet build /t:Test /p:RuntimeFlavor=mono /p:Configuration= +$(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= ``` -* Build and run library tests against Webassembly. See instructions for [Testing Webassembly](../libraries/testing-wasm.md) +* Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) -* Build and run library tests against Android. See instructions for [Testing Android](../libraries/testing-android.md) +# Running the Mono samples +There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. -* Build and run library tests against iOS. See instructions for [Testing iOS](../libraries/testing-apple.md) +## Sample for desktop Mono +It lives in `HelloWorld` folder. + +To run that program, you could simply cd to that directory and execute -# Running the Mono samples -There is a HelloWorld sample program lives at ``` -$(REPO_ROOT)/src/mono/netcore/sample/HelloWorld +make run ``` -This is a good way to write simple test programs and get a glimpse of how mono will work with the dotnet tooling. +Note that, it is configured with run with `Release` and `LLVM` mode by default. If you would like to work with other mode, you could edit the Makefile. + +## Sample for WebAssembly +It lives in `wasm` folder. There are two sub-folders `browser` and `console`. One is set up to run the program in browser, the other is set up to run the program in console. + +To run that program, you could simply cd to the desirable sub-folder and execute + +``` +make build && make run +``` + +Note that, it is configured with run with `Release` mode by default. If you would like to work with other mode, you could edit the Makefile. + +## Sample for Android +It lives in `Android` folder. + +To run that program, you could simply cd to that directory and execute + +``` +make run +``` + +Note that, it is configured with run with `x64` architecture and `Release` mode by default. If you would like to work with other configurations, you could edit the Makefile. + +## Sample for iOS +It lives in `Android` folder. To run that program, you could simply cd to that directory and execute @@ -80,5 +112,4 @@ To run that program, you could simply cd to that directory and execute make run ``` -Note that, it is configured with run with `Release` and `LLVM` mode by default. If you would like to work with other modes, -you could edit the Makefile from that folder. +Note that, it is configured with run with `x64` architecture and `Debug` mode by default. If you would like to work with other configurations, you could edit the Makefile. \ No newline at end of file From bdf7016217ce2c8f75edc111c531f1b44a3fc4a7 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 13 Nov 2020 11:25:42 -0500 Subject: [PATCH 14/23] Fix format --- docs/workflow/testing/mono/testing.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index a31b29f874950..4c637f252ab89 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -5,17 +5,18 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desi ## Runtime Tests ### Testing against Mono JIT: - * Build runtime tests by executing the follwiing command from `$(REPO_ROOT)/src/tests` +* Build runtime tests by executing the follwiing command from `$(REPO_ROOT)/src/tests` ``` ./build.sh excludemonofailures ``` - * Running a single test: + +* Running a single test: ``` cd ../mono/netcore make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" ``` - * Running all runtime tests: + * Running all runtime tests: ``` cd ../mono/netcore make run-tests-coreclr-all @@ -56,10 +57,8 @@ For more details about internals of the runtime tests, please refer to the [Core ## Libraries tests * Build and run library tests against Mono JIT: - -1. cd into the test library of your choice (`cd $(REPO_ROOT)/src/libraries//tests`) - -2. Run the tests + * cd into the test library of your choice (`cd $(REPO_ROOT)/src/libraries//tests`) + * Run the tests ``` $(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= From e5a377ed3cb57b91395e3e57f0ddcc94b42e576f Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Tue, 17 Nov 2020 12:32:18 -0500 Subject: [PATCH 15/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 4c637f252ab89..af3fae62732a8 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -5,7 +5,7 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desi ## Runtime Tests ### Testing against Mono JIT: -* Build runtime tests by executing the follwiing command from `$(REPO_ROOT)/src/tests` +Build the runtime tests by executing the following command from `$(REPO_ROOT)/src/tests` ``` ./build.sh excludemonofailures ``` @@ -111,4 +111,4 @@ To run that program, you could simply cd to that directory and execute make run ``` -Note that, it is configured with run with `x64` architecture and `Debug` mode by default. If you would like to work with other configurations, you could edit the Makefile. \ No newline at end of file +Note that, it is configured with run with `x64` architecture and `Debug` mode by default. If you would like to work with other configurations, you could edit the Makefile. From 270a93821fc542fb3e9e2b0b1144e3670ac2d6a4 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Tue, 17 Nov 2020 12:37:53 -0500 Subject: [PATCH 16/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index af3fae62732a8..2363dc6ef3deb 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -10,7 +10,7 @@ Build the runtime tests by executing the following command from `$(REPO_ROOT)/sr ./build.sh excludemonofailures ``` -* Running a single test: +Running a single test: ``` cd ../mono/netcore make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" From cecd564b6425b8271f7bfa5e824b44595d73aa19 Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Tue, 17 Nov 2020 12:53:28 -0500 Subject: [PATCH 17/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 2363dc6ef3deb..765d687f098a6 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -70,7 +70,7 @@ $(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= Date: Tue, 17 Nov 2020 12:55:37 -0500 Subject: [PATCH 18/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 765d687f098a6..3b50b2d790924 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -72,7 +72,7 @@ There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sam ## Sample for desktop Mono The desktop sample lives in `HelloWorld` folder. -To run that program, you could simply cd to that directory and execute +To run the sample, cd to the directory and execute: ``` make run From 121e5c3fe67cd377722b3db618c21ab54508b8a8 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Tue, 17 Nov 2020 15:53:22 -0500 Subject: [PATCH 19/23] PR feedback --- docs/workflow/testing/mono/testing.md | 66 ++++++++++++--------------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 3b50b2d790924..8f1aaee1e74dc 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -3,26 +3,27 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. ## Runtime Tests -### Testing against Mono JIT: +### Testing on desktop Mono: -Build the runtime tests by executing the following command from `$(REPO_ROOT)/src/tests` +To build the runtime tests for Mono JIT or interpreter, execut the following command from `$(REPO_ROOT)/src/tests` ``` ./build.sh excludemonofailures ``` -Running a single test: +Run individual test: ``` cd ../mono/netcore make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" ``` - * Running all runtime tests: +Run all tests: ``` cd ../mono/netcore make run-tests-coreclr-all ``` ### Testing on WebAssembly: +Build the runtime tests for WebAssembly ``` $(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm ``` @@ -36,9 +37,10 @@ The last few lines of the build log should contain something like this: -------------------------------------------------- ``` -Run that command, adding `wasm` to the end. +To run all tests, execute that command, adding `wasm` to the end. ### Testing on Android x64: +Build the runtime tests for Android x64 ``` $(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 ``` @@ -51,64 +53,52 @@ The last few lines of the build log should contain something like this: src/tests/run.sh --coreOverlayDir=artifacts/tests/coreclr/Android.x64.Release/Tests/Core_Root --testNativeBinDir=/artifacts/obj/coreclr/Android.x64.Release/tests --testRootDir=/artifacts/tests/coreclr/Android.x64.Release --copyNativeTestBin Release -------------------------------------------------- ``` -Run that command, adding `Android` at the end. +To run all tests, execute that command, adding `Android` at the end. +### Additional Documents For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) ## Libraries tests -* Build and run library tests against Mono JIT: - * cd into the test library of your choice (`cd $(REPO_ROOT)/src/libraries//tests`) - * Run the tests - +### Testing on desktop Mono +Build and run library tests against Mono JIT or interpreter ``` -$(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= +$(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= $(REPO_ROOT)/src/libraries//tests ``` - -* Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) +Alternatively, you could execute the following command from `$(REPO_ROOT)/src/mono/netcore` +``` +make run-tests-corefx- +``` +For example, the following command is for running System.Runtime tests: +``` +make run-tests-corefx-System.Runtime +``` +### Testing on mobile targets and WebAssembly +Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) # Running the Mono samples -There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. - -## Sample for desktop Mono -The desktop sample lives in `HelloWorld` folder. +There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are configured with a certain mode. Please refer to the Makefile for configuration details. If you would like to work with other mode, you could edit the Makefile. -To run the sample, cd to the directory and execute: +* To run the desktop Mono sample, cd to `HelloWorld` and execute: ``` make run ``` +Note that the default configuration of this sample is LLVM JIT. -Note that, it is configured with run with `Release` and `LLVM` mode by default. If you would like to work with other mode, you could edit the Makefile. - -## Sample for WebAssembly -It lives in `wasm` folder. There are two sub-folders `browser` and `console`. One is set up to run the program in browser, the other is set up to run the program in console. - -To run that program, you could simply cd to the desirable sub-folder and execute +* To run the WebAssembly sample, cd to `wasm`. There are two sub-folders `browser` and `console`. One is set up to run the progam in browser, the other is set up to run the program in console. Enter the desirable sub-folder and execute ``` make build && make run ``` -Note that, it is configured with run with `Release` mode by default. If you would like to work with other mode, you could edit the Makefile. - -## Sample for Android -It lives in `Android` folder. - -To run that program, you could simply cd to that directory and execute +* To run the Android sample, cd to `Android` and execute ``` make run ``` -Note that, it is configured with run with `x64` architecture and `Release` mode by default. If you would like to work with other configurations, you could edit the Makefile. - -## Sample for iOS -It lives in `Android` folder. - -To run that program, you could simply cd to that directory and execute +* To run the iOS sample, cd to `iOS` and execute ``` make run ``` - -Note that, it is configured with run with `x64` architecture and `Debug` mode by default. If you would like to work with other configurations, you could edit the Makefile. From bb6844e5535c5d07a47e15f9f8f2344a1d5d027a Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Fri, 20 Nov 2020 13:48:10 -0500 Subject: [PATCH 20/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 8f1aaee1e74dc..a87d8780ba276 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -5,7 +5,7 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desi ## Runtime Tests ### Testing on desktop Mono: -To build the runtime tests for Mono JIT or interpreter, execut the following command from `$(REPO_ROOT)/src/tests` +To build the runtime tests for Mono JIT or interpreter, execute the following command from `$(REPO_ROOT)/src/tests` ``` ./build.sh excludemonofailures ``` From 0bc668ac1b15eef5e8b73c906b93bd3439c1385f Mon Sep 17 00:00:00 2001 From: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> Date: Fri, 20 Nov 2020 13:56:48 -0500 Subject: [PATCH 21/23] Update docs/workflow/testing/mono/testing.md Co-authored-by: Ryan Lucia --- docs/workflow/testing/mono/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index a87d8780ba276..1c45a2c62dbce 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -76,7 +76,7 @@ make run-tests-corefx-System.Runtime Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) # Running the Mono samples -There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are configured with a certain mode. Please refer to the Makefile for configuration details. If you would like to work with other mode, you could edit the Makefile. +There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are set up to work with a specific configuration; please refer to the relevant Makefile for specifics. If you would like to work with a different configuration, you can edit the Makefile. * To run the desktop Mono sample, cd to `HelloWorld` and execute: From 3c6e23f4f6f2c2f0407ad8086307f00b8ae84da5 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 20 Nov 2020 14:18:19 -0500 Subject: [PATCH 22/23] Replace bullet points with sub-headers --- docs/workflow/testing/mono/testing.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index 1c45a2c62dbce..d4ea0cc311920 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -78,26 +78,30 @@ Build and run library tests against Webassembly, Android or iOS. See instruction # Running the Mono samples There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are set up to work with a specific configuration; please refer to the relevant Makefile for specifics. If you would like to work with a different configuration, you can edit the Makefile. -* To run the desktop Mono sample, cd to `HelloWorld` and execute: +## Running the sample for desktop Mono +To run the desktop Mono sample, cd to `HelloWorld` and execute: ``` make run ``` Note that the default configuration of this sample is LLVM JIT. -* To run the WebAssembly sample, cd to `wasm`. There are two sub-folders `browser` and `console`. One is set up to run the progam in browser, the other is set up to run the program in console. Enter the desirable sub-folder and execute +## Running the WebAssembly sample +To run the WebAssembly sample, cd to `wasm`. There are two sub-folders `browser` and `console`. One is set up to run the progam in browser, the other is set up to run the program in console. Enter the desirable sub-folder and execute ``` make build && make run ``` -* To run the Android sample, cd to `Android` and execute +## Running the Android sample +To run the Android sample, cd to `Android` and execute ``` make run ``` -* To run the iOS sample, cd to `iOS` and execute +## Running the iOS sample +To run the iOS sample, cd to `iOS` and execute ``` make run From 6d1918c7cb8fefe32b13f8b216ac4e54e4c1073e Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 20 Nov 2020 14:25:25 -0500 Subject: [PATCH 23/23] Update sub-headers to remove the duplicated part --- docs/workflow/testing/mono/testing.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index d4ea0cc311920..be444b2561771 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -3,7 +3,7 @@ Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. ## Runtime Tests -### Testing on desktop Mono: +### Desktop Mono: To build the runtime tests for Mono JIT or interpreter, execute the following command from `$(REPO_ROOT)/src/tests` ``` @@ -22,7 +22,7 @@ cd ../mono/netcore make run-tests-coreclr-all ``` -### Testing on WebAssembly: +### WebAssembly: Build the runtime tests for WebAssembly ``` $(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm @@ -39,7 +39,7 @@ The last few lines of the build log should contain something like this: To run all tests, execute that command, adding `wasm` to the end. -### Testing on Android x64: +### Android: Build the runtime tests for Android x64 ``` $(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 @@ -59,7 +59,7 @@ To run all tests, execute that command, adding `Android` at the end. For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) ## Libraries tests -### Testing on desktop Mono +### Desktop Mono Build and run library tests against Mono JIT or interpreter ``` $(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration= $(REPO_ROOT)/src/libraries//tests @@ -72,13 +72,13 @@ For example, the following command is for running System.Runtime tests: ``` make run-tests-corefx-System.Runtime ``` -### Testing on mobile targets and WebAssembly +### Mobile targets and WebAssembly Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) # Running the Mono samples There are a few convenient samples located in `$(REPO_ROOT)/src/mono/netcore/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are set up to work with a specific configuration; please refer to the relevant Makefile for specifics. If you would like to work with a different configuration, you can edit the Makefile. -## Running the sample for desktop Mono +## Desktop Mono To run the desktop Mono sample, cd to `HelloWorld` and execute: ``` @@ -86,21 +86,21 @@ make run ``` Note that the default configuration of this sample is LLVM JIT. -## Running the WebAssembly sample +## WebAssembly To run the WebAssembly sample, cd to `wasm`. There are two sub-folders `browser` and `console`. One is set up to run the progam in browser, the other is set up to run the program in console. Enter the desirable sub-folder and execute ``` make build && make run ``` -## Running the Android sample +## Android To run the Android sample, cd to `Android` and execute ``` make run ``` -## Running the iOS sample +## iOS To run the iOS sample, cd to `iOS` and execute ```