-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/runtime-master' into feature/N…
…ativeAOT
- Loading branch information
Showing
455 changed files
with
5,711 additions
and
5,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ | |
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,108 @@ | ||
# Running Tests using Mono Runtime | ||
# Running test suites using Mono | ||
|
||
## 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: | ||
Before running tests, [build Mono](../../building/mono/README.md) using the desired configuration. | ||
|
||
## Runtime Tests | ||
### Desktop Mono: | ||
|
||
To build the runtime tests for Mono JIT or interpreter, execute the following command from `$(REPO_ROOT)/src/tests` | ||
``` | ||
./build.sh excludemonofailures <release|debug> | ||
``` | ||
|
||
Run individual test: | ||
``` | ||
cd ../mono/netcore | ||
make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh" | ||
``` | ||
|
||
Run all tests: | ||
``` | ||
cd ../mono/netcore | ||
make run-tests-coreclr-all | ||
``` | ||
|
||
### WebAssembly: | ||
Build the runtime tests for WebAssembly | ||
``` | ||
$(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Browser wasm <Release/Debug> | ||
``` | ||
|
||
The last few lines of the build log should contain something like this: | ||
``` | ||
dotnet build /t:RunCoreClrTests $(REPO_ROOT)/src/mono/mono.proj | ||
-------------------------------------------------- | ||
Example run.sh command | ||
src/tests/run.sh --coreOverlayDir=<repo_root>artifacts/tests/coreclr/Browser.wasm.Release/Tests/Core_Root --testNativeBinDir=<repo_root>/artifacts/obj/coreclr/Browser.wasm.Release/tests --testRootDir=<repo_root>/artifacts/tests/coreclr/Browser.wasm.Release --copyNativeTestBin Release | ||
-------------------------------------------------- | ||
``` | ||
|
||
If you want to run individual tests, execute this command: | ||
To run all tests, execute that command, adding `wasm` to the end. | ||
|
||
### Android: | ||
Build the runtime tests for Android x64 | ||
``` | ||
$(REPO_ROOT)/src/tests/build.sh -skipstressdependencies -excludemonofailures os Android x64 <Release/Debug> | ||
``` | ||
dotnet build /t:RunCoreClrTest /p:CoreClrTest="<TestName>" $(REPO_ROOT)/src/mono/mono.proj | ||
|
||
The last few lines of the build log should contain something like this: | ||
``` | ||
-------------------------------------------------- | ||
Example run.sh command | ||
## Running Library Tests | ||
Running library tests against Mono is straightforward regardless of configuration. Simply run the following commands: | ||
src/tests/run.sh --coreOverlayDir=<repo_root>artifacts/tests/coreclr/Android.x64.Release/Tests/Core_Root --testNativeBinDir=<repo_root>/artifacts/obj/coreclr/Android.x64.Release/tests --testRootDir=<repo_root>/artifacts/tests/coreclr/Android.x64.Release --copyNativeTestBin Release | ||
-------------------------------------------------- | ||
``` | ||
To run all tests, execute that command, adding `Android` at the end. | ||
|
||
1. Build and set the RuntimeFlavor | ||
### Additional Documents | ||
For more details about internals of the runtime tests, please refer to the [CoreCLR testing documents](../coreclr) | ||
|
||
```bash | ||
./build.sh /p:RuntimeFlavor=mono | ||
## Libraries tests | ||
### Desktop Mono | ||
Build and run library tests against Mono JIT or interpreter | ||
``` | ||
$(REPO_ROOT)/dotnet.sh build /t:Test /p:RuntimeFlavor=mono /p:Configuration=<Release/Debug> $(REPO_ROOT)/src/libraries/<library>/tests | ||
``` | ||
or on Windows | ||
```bat | ||
build.cmd /p:RuntimeFlavor=mono | ||
Alternatively, you could execute the following command from `$(REPO_ROOT)/src/mono/netcore` | ||
``` | ||
make run-tests-corefx-<library> | ||
``` | ||
For example, the following command is for running System.Runtime tests: | ||
``` | ||
make run-tests-corefx-System.Runtime | ||
``` | ||
### Mobile targets and WebAssembly | ||
Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) | ||
|
||
2. cd into the test library of your choice (`cd src/libraries/<library>/tests`) | ||
# 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. | ||
|
||
3. Run the tests | ||
## Desktop Mono | ||
To run the desktop Mono sample, cd to `HelloWorld` and execute: | ||
|
||
``` | ||
dotnet build /t:Test /p:RuntimeFlavor=mono | ||
make run | ||
``` | ||
Note that the default configuration of this sample is LLVM JIT. | ||
|
||
# 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. | ||
## 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 | ||
``` | ||
|
||
To generate a local .dotnet-mono, execute this command: | ||
## Android | ||
To run the Android sample, cd to `Android` and execute | ||
|
||
``` | ||
dotnet build /t:PatchLocalMonoDotnet $(REPO_ROOT)/src/mono/mono.proj | ||
make run | ||
``` | ||
|
||
You can then, for example, run our HelloWorld sample via: | ||
## iOS | ||
To run the iOS sample, cd to `iOS` and execute | ||
|
||
``` | ||
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 | ||
make run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.