-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow coverage tests to ignore test modes, and to enable color in coverage reports #119034
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
sorry, too busy to review this r? compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me unless you want to adopt my suggestion below
58a15e7
to
3342195
Compare
Having |
Normally, each test in `tests/coverage` is automatically run in both `coverage-map` mode and `coverage-run` mode. This new family of directives allows an individual test to specify that it should not be run in a particular mode.
@bors r+ |
…mpiler-errors Rollup of 10 pull requests Successful merges: - rust-lang#119034 (Allow coverage tests to ignore test modes, and to enable color in coverage reports) - rust-lang#119148 (Tweak suggestions for bare trait used as a type) - rust-lang#119538 (Cleanup error handlers: round 5) - rust-lang#119566 (Remove `-Zdump-mir-spanview`) - rust-lang#119567 (Remove `-Zreport-delayed-bugs`.) - rust-lang#119577 (Migrate memory overlap check from validator to lint) - rust-lang#119583 (Make `intrinsics::assume` const stable) - rust-lang#119586 ([rustdoc] Fix invalid handling for static method calls in jump to definition feature) - rust-lang#119588 (Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support table) - rust-lang#119601 (`Emitter` cleanups) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#119034 - Zalathar:ignore-mode, r=davidtwco Allow coverage tests to ignore test modes, and to enable color in coverage reports This PR adds two new header directives to compiletest, intended for use by coverage tests (and by rust-lang#119033 in particular). The new headers are: - `// ignore-mode-{mode}` causes a test to not be run in a particular compiletest mode (e.g. `ignore-mode-coverage-run`). - This can theoretically be used by any test, but coverage tests are currently the only ones that automatically run in multiple modes, so it's not very useful for other kinds of test. - `// llvm-cov-flags: --use-color` makes `coverage-run` tests pass the flag `--use-color` when generating coverage reports. - For most tests, non-coloured reports are easier to read and more portable across platforms. But for rust-lang#119033 specifically, we want to test that `llvm-cov` slices up source text correctly, which only happens when colour output is enabled.
This PR adds two new header directives to compiletest, intended for use by coverage tests (and by #119033 in particular).
The new headers are:
// ignore-mode-{mode}
causes a test to not be run in a particular compiletest mode (e.g.ignore-mode-coverage-run
).// llvm-cov-flags: --use-color
makescoverage-run
tests pass the flag--use-color
when generating coverage reports.llvm-cov
expects column numbers to be bytes, not code points #119033 specifically, we want to test thatllvm-cov
slices up source text correctly, which only happens when colour output is enabled.