You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: It will be possible to generate a wasm.profraw with the following command:
RUSTFLAGS="-Cinstrument-coverage -Zno-profiler-runtime --emit=llvm-ir" wasm-pack test --chrome --headless --coverage --profraw-out=wasm.profraw
I would to add support for this operation in cargo-llvm-cov and would therefore like to discuss what the interface and the implementation for this should look like.
Interface
For the interface, I propose adding a --wasm flag to llvm-cov test which then runs wasm-pack test instead of cargo test.
Implementation
If the --wasm flag is present in the llvm-cov test command, then we execute the command written above and dump the profraw in the usual llvm-cov-target/.
LLVM currently isn't able to read the debuginfo from the .wasm, which is why we use --emit=llvm-ir in the RUSTFLAGS. We now need to generate a native .o with clang, so llvm-cov can map the hits in the profdata back to lines in the source code.
Follows up from #221.
I'm currently working on generating profraw data from
wasm-pack test
: rustwasm/wasm-bindgen#3782TLDR: It will be possible to generate a
wasm.profraw
with the following command:I would to add support for this operation in
cargo-llvm-cov
and would therefore like to discuss what the interface and the implementation for this should look like.Interface
For the interface, I propose adding a
--wasm
flag tollvm-cov test
which then runswasm-pack test
instead ofcargo test
.Implementation
If the
--wasm
flag is present in thellvm-cov test
command, then we execute the command written above and dump the profraw in the usualllvm-cov-target/
.LLVM currently isn't able to read the debuginfo from the .wasm, which is why we use
--emit=llvm-ir
in theRUSTFLAGS
. We now need to generate a native.o
withclang
, sollvm-cov
can map the hits in the profdata back to lines in the source code.Merging the profdata should work just before.
Reporting needs to additionally pass our generated
.o
as-object
tollvm-cov
.Let me know what you think! I'm happy to submit a PR if this looks good to everyone.
The text was updated successfully, but these errors were encountered: