Files
dotnet-runtime/docs/workflow/testing/libraries/testing-wasm.md
T
Maxim Lipnin 84c64c5801 Add initial doc about testing libraries on WebAssembly (#37478)
* Add initial doc about testing libraries on WebAssembly

* Address feedback

* Address feedback
2020-06-08 18:01:51 +02:00

1.6 KiB

Testing Libraries on WebAssembly

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.62

If you use jsvu, first add its location to PATH variable
e.g. for V8

PATH=/Users/<your_user>/.jsvu/:$PATH V8

Building Libs and Tests for WebAssembly

Now we're ready to build everything for WebAssembly (for more details, please read this document):

./build.sh --arch wasm --os Browser -c release

and even run tests one by one for each library:

./build.sh --subset libs.tests -t --arch wasm --os Browser -c release

Running individual test suites

The following shows how to run tests for a specific library

./dotnet.sh build /t:Test src/Common/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=release

Running tests using different JavaScript engines

It's possible to set a JavaScript engine explicitly by adding /p:JSEngine property:

./dotnet.sh build /t:Test src/Common/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=release /p:JSEngine=SpiderMonkey

At the moment supported values are:

  • V8
  • JavaScriptCore
  • SpiderMonkey

By default, V8 engine is used.

Test App Design

TBD

Obtaining the logs

TBD

Existing Limitations

TBD