-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
kcov can't get correct coverage and write files in tests #242
Comments
Sounds like two separate issues. Anyway, can you check that your binary is built with debug info? If you use Also, you can run kcov with debugging, If the sources are not where kcov (and the debug info!) expects them to be, there is the |
for the first question: readelf -S target/debug/test_api-57d82527abd0a87b
[36] .debug_str PROGBITS 0000000000000000 0240e828
0000000000b04265 0000000000000001 MS 0 0 1 So yes. This is Don't know if kcov found source files. But I don't think all Also tried to force the ./kcov-build/usr/local/bin/kcov --replace-src-path src --exclude-pattern=/.cargo, --verify target/cov/ target/debug/test_api-57d82527abd0a87b
kcov: error: src is formatted incorrectly |
The source-path fix should look something like Something is wrong with the source lookup though, but I can't quite see what it is |
Ok I'll try. If you want more details, the repo is here https://github.com/AmarOk1412/rori_core |
I've now built your project, but can't reproduce the problem. I built with
which does get me coverage like this (I've excluded system code):
I don't know rust, so this on a "fresh" system where I just installed rust via the shell script installer. |
Oh! It works if I add Thanks for all! |
Sorry this took so long, I should have suspected filtering to start with. I can't really say why it didn't work for starters, Anyway, I typically run kcov without options first, i.e.,
and then see what filtering needs to be done. It's often quite obvious which parts are interesting and not. |
Np. Everybody has something else to do :) |
Hei!
I'd just tried to use
kcov
to do my coverage. The structure of my project is:I installed kcov with:
My tests are executed via
RUST_TEST_THREADS=1 RUST_BACKTRACE=1 cargo test -- --nocapture
After that, I run kcov with
for file in target/debug/test_*[^\.d]; do mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify --coveralls-id=$TRAVIS_JOB_ID "target/cov/$(basename $file)" "$file"; done
. And I see that I got 0% in coverage.So I tried to launch this on my computer:
(test-api is one of my file). The test succeed. So I opened:
firefox target/cov/index.html
:I think I missed something but I don't know what.
Another thing (But I'll dig later). Another test is writing a sqlite database on the system. When I run this test with kcov, I've got errors which looks like that a user don't have the permission to manipulate files.
Have a nice day!
The text was updated successfully, but these errors were encountered: