Skip to content

As of 1.19 it is not possible to accurately measure unit test coverage #43410

@ctz

Description

@ctz

1.19 prevents access to -Zno-landing-pads. I was using that to get accurate test coverage; without it all landing pads appear as uncovered code at the start and end of every function.

-Cpanic=abort is intended to be the stable replacement for -Zno-landing-pads but unfortunately that isn't supported for unit tests (apparently, because libtest requires unwinding support).

I'd like a way to do any of the following on stable:

  • restore no-landing-pads behaviour, or,
  • have panic=abort work for unit tests. Note that I don't much care that should_panic tests wouldn't work.

Is there some combination of cargo/rustc options that might achieve that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions