-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage #13046
Comments
I don't think we have any direct support for that today, but its sounds like it would be fairly easy to add. Sounds like it would involve a new option and new compiler-rt variant added to |
Is this the place to start looking at https://github.com/emscripten-core/emscripten/blob/master/tools/system_libs.py#L642 ? I never dealt with the internals of emscripten. Probably will have lots of questions. |
This is enought make it work up until llvm-cov tries to read the named data sections in the binary and can't find them. For this final part to work we probably need to switch the object format to using multiple code and data sections: WebAssembly/tool-conventions#138 Not sure if its worth submitting this part in isolation without a fully working solution? See #13046
I took an initial stab at getting this to work: #13072 It works up until llvm-cov fails to parse the data sections in the wasm executable. |
This is enought make it work up until llvm-cov tries to read the named data sections in the binary and can't find them. For this final part to work we probably need to switch the object format to using multiple code and data sections: WebAssembly/tool-conventions#138 Not sure if its worth submitting this part in isolation without a fully working solution? See #13046
It seems that the gcc-like coverage tool will get worked with #13072. Adding compile option Therefore, I think that we have already a good reason to merge #13072. |
Hello, is there any update on this effort? |
wasm-ld: error: /var/folders/61/x35v93n50_5g1dfjrtprr2dw0000gn/T/emscripten_temp_xjrzk63_/demo_0.o: undefined symbol: __llvm_profile_runtime have emcc supported code coverage? need help :) |
No, emcc does not yet support this method of doing code coverage. #13072 is a start, but that has yet to land. |
It looks like SanitizerCoverage works. I've tried the demo by replacing clang++ to em++
|
@junyuecao this is not the same. |
Hey. I've created a tutorial how to generate code coverage for webassembly projects. This one is dedicated for blockchains using WASM VM, however I think it may be useful to you too - https://github.com/hknio/code-coverage-for-webassembly |
Is there anything done in emscripten for enabling Tests Code Coverage reports generation?
I found this very interesting article on how to do it manually.
Requires to recompile compiler-rt.
The text was updated successfully, but these errors were encountered: