Commit Graph

3 Commits

Author SHA1 Message Date
Zalathar e96b4e479a coverage: Extract `executor::block_on` from several async coverage tests
By moving `block_on` to an auxiliary crate, we avoid having to keep a separate
copy of it in every async test.

(This also incorporates some small tweaks to the headers in `await_ready.rs`.)
2024-09-10 16:08:36 +10:00
Jonathan Conder 25d183057e coverage: Treat await similar to a macro
Currently `await` is only counted towards coverage if the containing
function is suspended and resumed at least once. This is because it
expands to code which contains a branch on the discriminant of `Poll`.

By treating it like a branching macro (e.g. `assert!`), these
implementation details will be hidden from the coverage results.
2024-09-06 17:01:59 +12:00
Jonathan Conder 3446ca535e coverage: Add test to codify existing behavior
Currently `await` is only counted towards coverage if the containing
function is suspended and resumed at least once. A future commit will
fix this and update the test to reflect the new behavior.
2024-09-06 16:50:23 +12:00