1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-11 10:18:21 +09:00
Satori/docs/workflow/testing/mono/testing.md
Viktor Hofer 33f2807fc6
Remove BuildAndTest and RebuildAndTest target in favor of Test (#33151)
* Implicitly build when invoking the test target

To get closer to the VSTest behavior this changes the Test target to
implicitly invoke the Build target unless /p:TestNoBuild is passed in.
(VSTest uses VSTestNoBuild which is controlled by the
dotnet test --no-build flag)

* Fix error logging for test outputs

* Update dotnet msbuild to build docs

* Update ReportGenerator global tool version

Updating ReportGenerator's version to 4.5.0 which removes unnecessary
logging (args passed in).
2020-03-04 19:40:19 +01:00

54 lines
No EOL
1.5 KiB
Markdown

# 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
```
If you want to run individual tests, execute this command:
```
dotnet build /t:RunCoreClrTest /p:CoreClrTest="<TestName>" $(REPO_ROOT)/src/mono/mono.proj
```
## Running Library Tests
Running library tests against Mono is straightforward regardless of configuration. Simply run the following commands:
1. Build and set the RuntimeFlavor
```bash
./build.sh /p:RuntimeFlavor=mono
```
or on Windows
```bat
build.cmd /p:RuntimeFlavor=mono
```
2. cd into the test library of your choice (`cd src/libraries/<library>/tests`)
3. Run the tests
```
dotnet build /t:Test /p:RuntimeFlavor=mono
```
# 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.
To generate a local .dotnet-mono, execute this command:
```
dotnet build /t:PatchLocalMonoDotnet $(REPO_ROOT)/src/mono/mono.proj
```
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
```