Skip to content
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

Warn users when output directory contains target binary #272

Open
mcraveiro opened this issue Oct 15, 2018 · 3 comments
Open

Warn users when output directory contains target binary #272

mcraveiro opened this issue Oct 15, 2018 · 3 comments

Comments

@mcraveiro
Copy link

mcraveiro commented Oct 15, 2018

Hi kcov developers,

Many thanks for a very useful tool. I just did something really silly and it took me a little while to figure it out, which led me to wonder if its not worth alerting users: I set my output directory to the same directory as the binary, and as a result got the following error:

kcov: error: elf_begin failed on /FULL_PATH_TO_DIR/dogen.annotations.tests

kcov: error: Can't start/attach to /FULL_PATH_TO_DIR/dogen.annotations.tests

This happened because kcov appears to delete the target binary and create a simlink to the reporting directory, and then (I assume) tries to open the directory as if it as a ELF binary:

lrwxrwxrwx  1 marco marco      150 Oct 15 15:48 dogen.annotations.tests -> /FULL_PATH_TO_DIR/dogen.annotations.tests.d5518294725c92ef/
drwxr-xr-x  4 marco marco     4096 Oct 15 15:48 dogen.annotations.tests.d5518294725c92ef

It may be worth issuing a warning informing users that their command line options are not sensible :-) Apologies if this has already been submitted, but could not spot it.

Many thanks for your time

Marco

@SimonKagstrom
Copy link
Owner

SimonKagstrom commented Oct 16, 2018 via email

@mcraveiro
Copy link
Author

mcraveiro commented Oct 16, 2018

Thanks @SimonKagstrom. By the by, may I just add that, after years of gcov and associated tooling, kcov was a joy to setup! I had even given up on having code coverage for a while, just out of fear of facing gcov, but then I saw kcov! :-) got it working in slightly over half-a-day for both coveralls and codecov! amazing stuff.

@BotellaA
Copy link
Contributor

Thanks a lot for this issue!! Really helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants