Open mfreeborn opened 2 years ago
As for the second issue, it is the same issue as https://github.com/rust-lang/rust/issues/81684.
One or both of the following may work:
profiler = true
and this patch (once this PR is merged, building own toolchain may no longer be necessary)As for the first issue, I think we can add a subcommand as we did for nextest. something like: cargo llvm-cov wasm-pack test --node
.
That said, the second issue needs to be resolved first.
@taiki-e Hey, can we do anything to help develop this feature? The PR mentioned above in Rust repos was closed, and a lot has changed in the past year.
I don't think the situation has changed much on this issue. Someone will need to either contribute to rustc to improve the situation (e.g., by taking over a PR that closed as inactive) or investigate (and document) how to make cargo-llvm-cov work with a profiler-builtins alternative.
Hi, is there any updates? Thanks! (I guess no...? :/ )
Actually. Here is a spicy boy I made.
https://github.com/hknio/wasmcov
It doesn't use cargo-llvm-cov, but uses the llvm-cov package directly.
With https://github.com/rustwasm/wasm-bindgen/pull/3782, I think we can follow up here.
We could do something like cargo llvm-cov --wasm-bindgen test
to generate the profraw with wasm-pack
and then process it.
An annoying thing is that we have to use --emit=llvm-ir
because llvm-cov
can't get the debug info from the .wasm
(despite the info being in there). So we would have to run clang target/wasm32-unknown-unknown/debug/deps/{file_name}.ll -Wno-override-module -c -o {file_name}.o
and then search for this .o
as the binary for the reporting.
I would really love this. It would mean you can merge normal tests with wasm_bindgen_tests easily.
I'd really like to be able to run my Web Assembly tests and get coverage reports for them.
First issue, can I specify a custom binary to run e.g. instead of
cargo test
, my test command iswasm-pack test --node
.Second issue, I get a compile error when trying to build on
wasm32-unknown-unknown
:Is the above possible?