In order to be able to run tests, the following JavaScript engines should be installed:
- V8
- JavaScriptCore
- SpiderMonkey
They can be installed as a part of jsvu.
Please make sure that a JavaScript engine binary is available via command line, e.g. for V8:
$ v8
V8 version 8.5.62If you use jsvu, first add its location to PATH variable
e.g. for V8
PATH=/Users/<your_user>/.jsvu/:$PATH V8It's possible to run tests in a browser instance:
- An installation of ChromeDriver - WebDriver for Chrome is required. Make sure to read Downloads/Version Selection to setup a working installation of ChromeDriver.
- Include the ChromeDriver - WebDriver for Chrome location in your PATH environment. Default is
/Users/<your_user>/.chromedriver
PATH=/Users/<your_user>/.chromedriver:$PATHNow we're ready to build everything for WebAssembly (for more details, please read this document):
./build.sh -os Browser -c Releaseand even run tests one by one for each library:
./build.sh libs.tests -test -os Browser -c Release
The following shows how to run tests for a specific library
./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release
To run all tests, including "outer loop" tests (which are typically slower and in some test suites less reliable, but which are more comprehensive):
./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:Outerloop=true
It's possible to set a JavaScript engine explicitly by adding /p:JSEngine property:
./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:JSEngine=SpiderMonkey
At the moment supported values are:
V8JavaScriptCoreSpiderMonkey
By default, V8 engine is used.
The following shows how to run tests for a specific library
- CLI
XHARNESS_COMMAND=test-browser ./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release - Makefile target
run-browser-tests-<test>make -C src/mono/wasm/ run-browser-tests-System.AppContext
To run all tests, including "outer loop" tests (which are typically slower and in some test suites less reliable, but which are more comprehensive):
-
CLI
XHARNESS_COMMAND=test-browser ./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:Outerloop=true -
Makefile target
run-browser-tests-<test>MSBUILD_ARGS=/p:OuterLoop=true make -C src/mono/wasm/ run-browser-tests-System.AppContext
Add the following to the comment of a PR.
/azp run runtime-libraries-mono outerloop
TBD
TBD
TBD