Skip to content

cargo test --no-run should print paths to stdout #12932

Closed
@juliusl

Description

@juliusl

Problem

#10346 allowed printing the executable path from cargo test --no-run. It works however it prints to stderr and doesn't print the paths to stdout.

Proposed Solution

Print just the paths to stdout.

Notes

You would use --no-run for example if you need to execute a cross-arch binary. For example, qemu-aarch64 <path-to-binary>.
With this change it would be possible to do something like this.

cargo test --target aarch64-unknown-linux-gnu --no-run | xargs -L1 qemu-aarch64

Today the command looks like this,

cargo test --target aarch64-unknown-linux-gnu --no-run --message-format=json | jq  -r 'select(.reason=="compiler-artifact") | .executable | select(. != null)' | xargs -L1 qemu-aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-testS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions