Skip to content

Report test case timing information #46610

Closed
@vitiral

Description

@vitiral

Note: This was originally opened at rust-lang/cargo#4674 on Oct 29th by @mgeisler, who commented that he would open a new issue here, but that seems to have never happened. This issue should not cover the "ordering" of test cases that they suggested.

I would like to ask that a feature to output the runtime (in float seconds to 3 significant digits) of tests be added (at least as a flag) to help find which tests are taking a long time. It would be parituclarily useful in build systems where the user might not have as much information (i.e. is not watching the tests run).

We could also consider outputting the "system" time as well as the "real" time.

Some possible flags:

  • --report-time
  • --report-timing
  • ---report-duration

But I would be pretty open to anything.

Preferably we would just do this by default (with no flag) but my bet is that enough people depend on the stdout of cargo test that that would (almost) be considered a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-libtestArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions