Commit Graph

13 Commits

Author SHA1 Message Date
Zalathar
a4cb31bb58 coverage: Regression test for inconsistent handling of closure spans 2023-09-18 22:33:05 +10:00
Zalathar
4690f97099 coverage: Fix an unstable-sort inconsistency in coverage spans
This code was calling `sort_unstable_by`, but failed to impose a total order on
the initial spans. That resulted in unpredictable handling of closure spans,
producing inconsistencies in the coverage maps and in user-visible coverage
reports.

This patch fixes the problem by always sorting closure spans before
otherwise-identical non-closure spans, and also switches to a stable sort in
case the ordering is still not total.
2023-09-18 21:28:56 +10:00
Andy Caldwell
0ca6c38cc2
Fix up run-coverage and coverage-map/status-quo tests 2023-09-08 12:46:23 +01:00
Ding Xiang Fei
67553e8a11
update tests that are ignored by debug 2023-09-01 04:01:54 +08:00
Zalathar
8d91e71e9a Various trivial formatting fixes in run-coverage tests
These changes were made by manually running `rustfmt` on all of the test files,
and then manually undoing all cases where the original formatting appeared to
have been deliberate.

  `rustfmt +nightly --config-path=/dev/null --edition=2021 tests/run-coverage*/**/*.rs`
2023-08-26 14:35:34 +10:00
Zalathar
4da38c31d2 Tidy up some awkwardly-placed comments in tests
Prior to #114875, these tests were very sensitive to lines being added/removed,
so the migration to `run-coverage` in #112300 tried hard to avoid disturbing
the existing line numbers. That resulted in some awkward reshuffling when
certain comments/directives needed to be added or moved.

Now that we don't have to worry about preserving line numbers, we can rearrange
those comments into a more conventional layout.
2023-08-26 14:35:34 +10:00
Zalathar
72b721f48e Resolve all warnings in run-coverage tests
When one of these tests fails, any compiler warnings will be printed to the
console, which makes it harder to track down the actual reason for failure.

(The outstanding warnings were found by temporarily adding `-Dwarnings` to the
compiler arguments for `RunCoverage` in `src/tools/compiletest/src/runtest.rs`.)
2023-08-26 14:35:34 +10:00
Zalathar
bfb16545a3 coverage: Anonymize line numbers in run-coverage test snapshots
This makes the test snapshots less sensitive to lines being added/removed.
2023-08-17 10:03:32 +10:00
Mahdi Dibaiee
e55583c4b8 refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
Zalathar
e4b81f6d71 Re-enable some coverage tests on Linux 2023-07-06 10:19:31 +10:00
Zalathar
edd051c31e Re-bless the newly-migrated tests 2023-06-28 11:09:19 +10:00
Zalathar
a2c0b38897 Migrate the remaining run-make/coverage-reports tests over to run-coverage
To make it easier to verify that the output snapshots have been migrated
faithfully, this change adds some temporary helper code that lets us avoid
having to completely re-bless the existing snapshots.

A later change in this PR will then re-bless the tests and remove the temporary
helper code.
2023-06-28 11:09:19 +10:00
Zalathar
e0625b4586 Migrate most of the existing coverage tests over to run-coverage 2023-06-28 11:09:19 +10:00