Open
Description
Problem
cargo does not explain doctest binary path location
Thus, need to hard code doctest binary path location.
https://doc.rust-lang.org/rustc/instrument-coverage.html#including-doc-tests
$ llvm-cov report \
$( \
for file in \
$( \
RUSTFLAGS="-C instrument-coverage" \
RUSTDOCFLAGS="-C instrument-coverage -Z unstable-options --persist-doctests target/debug/doctestbins" \
cargo test --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
) \
target/debug/doctestbins/*/rust_out; \
do \
[[ -x $file ]] && printf "%s %s " -object $file; \
done \
) \
--instr-profile=json5format.profdata --summary-only # and/or other options
Proposed Solution
cargo should explain doctest binary path location
$ "${cmd[@]}" --no-run --message-format=json | jq -r ".filenames[]" | grep doctestbins
target/debug/doctestbins/XXX/rust_out
target/debug/doctestbins/XXX/rust_out
target/debug/doctestbins/XXX/rust_out
Notes
channel = "nightly-2025-04-14"
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status