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

cargo llvm-cov report --lcov fails: No filenames specified! #304

Closed
DanielT opened this issue Aug 22, 2023 · 5 comments
Closed

cargo llvm-cov report --lcov fails: No filenames specified! #304

DanielT opened this issue Aug 22, 2023 · 5 comments
Labels
C-question Category: A question

Comments

@DanielT
Copy link

DanielT commented Aug 22, 2023

I'm working on a Python module, implemented in Rust using PyO3 (this one: autosar-data-py)
Testing it using tests on the Rust side doesn't make sense; I wrote test in Python using pytest instead.
I would also like to generate code coverage from the pytest run.

The workflow for testing is:

  1. create and activate a python virtualenv in the project
  2. run maturin develop, which runs cargo build, builds the Python wheel and installs it into the virtualenv
  3. run pytest

To gather coverage info I tried to:

  1. Set RUSTFLAGS and LLVM_PROFILE_FILE as shown by cargo llvm-cov show-env --export-prefix
  2. build the module and run pytest as above
  3. run cargo llvm-cov report --lcov

This last command fails with the error message "No filenames specified!" and no coverage is generated.

@taiki-e
Copy link
Owner

taiki-e commented Aug 22, 2023

Set RUSTFLAGS and LLVM_PROFILE_FILE as shown by cargo llvm-cov show-env --export-prefix

You have to set all env vars that show-env shows, not only two env vars.

@taiki-e taiki-e added the C-question Category: A question label Aug 22, 2023
@DanielT
Copy link
Author

DanielT commented Aug 23, 2023

It looks like this only works on Linux, but not on Windows.
On windows I set all environment variables shown by show-env and still had the problem.

@taiki-e
Copy link
Owner

taiki-e commented Aug 23, 2023

only works on Linux, but not on Windows.

Ah, if so, this is probably a duplicate of #300.

@taiki-e
Copy link
Owner

taiki-e commented Aug 23, 2023

Closing as duplicate of #300 for now.

@taiki-e taiki-e closed this as completed Aug 23, 2023
@taiki-e
Copy link
Owner

taiki-e commented Aug 23, 2023

This should be fixed in 0.5.30 (#307).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question
Projects
None yet
Development

No branches or pull requests

2 participants