Skip to content

--quiet propagation is unavailable to custom test harnesses #15465

Open
@kpreid

Description

@kpreid

Currently, Cargo will forward the --quiet option from its command line to test binaries. However, it does not do this when harness = false.

if unit.target.harness() && gctx.shell().verbosity() == Verbosity::Quiet {
cmd.arg("--quiet");
}

This means that test targets with custom test harnesses cannot replicate the automatic coordination the rustc test harness gets. Given the stated plans to promote custom test harnesses over adding more features to libtest, I believe this behavior needs to be revised.

I think it is likely that the correct solution here is to add some larger API for more structured, extensible communication between cargo and a custom test harness, rather than changing what individual args are sent. Still, I’m filing this issue to make sure this is considered and to document the quirk for anyone else who is writing a libtest-compatible harness and debugging why their output stays verbose.

@rustbot label +Command-test +A-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cliArea: Command-line interface, option parsing, etc.C-enhancementCategory: enhancementCommand-testS-needs-rfcStatus: Needs an RFC to make progress.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions