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

--follow-exec is not working (used to work in some earlier version) #1684

Open
DenialAdams opened this issue Jan 21, 2025 · 3 comments
Open
Assignees

Comments

@DenialAdams
Copy link

DenialAdams commented Jan 21, 2025

Describe the bug
I am not seeing any collected coverage data from child executables despite using --follow-exec (with --engine llvm, otherwise I get a segfault).

I know that this same workflow used to work in an earlier combination of rustc+tarpaulin, because I had these steps written down.

To Reproduce
For now, the only repro I have uses my own project:
git clone https://github.com/DenialAdams/roland.git
RUSTFLAGS="-Cinstrument-coverage -Cstrip=none -Clink-dead-code -Cdebuginfo=2" cargo build --bin rolandc_cli
cargo tarpaulin --skip-clean --implicit-test-threads --follow-exec --engine llvm --command build --bin roland_test_runner -o html -- {{justfile_directory()}}/tests/ --cli {{justfile_directory()}}/target/debug/rolandc_cli

Observe that coverage data is found only for the test runner itself. There is no test data accumulated for the compiler:

2025-01-21T05:54:40.354193Z  INFO cargo_tarpaulin::report: Coverage Results:
|| Tested/Total Lines:
|| roland_test_runner/src/main.rs: 159/275
|| rolandc/src/backend/qbe.rs: 0/5
|| rolandc/src/backend/wasm.rs: 0/20
|| rolandc/src/error_handling.rs: 0/62
|| rolandc/src/imports.rs: 0/76
|| rolandc/src/lib.rs: 0/177
|| rolandc/src/parse.rs: 0/8
|| rolandc/src/pp.rs: 0/295
|| rolandc/src/semantic_analysis/validator.rs: 0/245
|| rolandc/src/type_data.rs: 0/147
|| rolandc_cli/src/main.rs: 0/2
|| rolandc_lsp/src/main.rs: 0/9

Expected behavior
Coverage is collected for the spawned executables in addition to the main executable under test.


Thanks very much :)

@DenialAdams
Copy link
Author

The assumption I am making in the title could be wrong. I realized that it's possible that I am getting the flags wrong in step 2 of the reproduction. Or maybe something else... Let me know if I can provide any more info.

@xd009642
Copy link
Owner

It might be an instance of #1676 if the CWD is the roland_test_runner which I'm currently working on as my next issue just needs some design work

@DenialAdams
Copy link
Author

It might be an instance of #1676 if the CWD is the roland_test_runner which I'm currently working on as my next issue just needs some design work

CWD should be the workspace root (all crates involved are in the same workspace.) But I'm happy to wait and try again when that lands

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

2 participants