-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Márk Tolmács edited this page Jun 25, 2023
·
3 revisions
- Install the
wasm32-unknown-unknown
target, which is required for the tests to run:
rustup target add wasm32-unknown-unknown [--target nightly]
- Strip the WASM file from DWARF debug symbols if you generated a sourcemap file and will not use the embedded DWARF data. You can use the wasm-strip tool from WebAssembly Binary Toolkit (wabt):
wasm-strip /target/wasm32-unknown-unknown/<debug|release>/<projectname>.wasm
Note: wasm2map does not do this automatically, because Google Chore is working on directly reading DWARF data from WASM, so to support all platforms, you might want to keep it.
Alternatively, you might want to keep the DWARF symbols in a separate file.
- Install the cargo command
llvm-cov
:
cargo install cargo-llvm-cov
- Run text report:
cargo llvm-cov
- Integrate with IDE: Note: VSCode has 'Coverage Gutters' extension which can read it.
cargo llvm-cov --lcov --output-path lcov.info