about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/coherence/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-21 14:33:14 +0000
committerbors <bors@rust-lang.org>2023-03-21 14:33:14 +0000
commit66676820eb801473f21006fa64315ce3c42402eb (patch)
treef930681036fde2a0c527ea70d12e66a3bd0b841a /compiler/rustc_hir_analysis/src/coherence/mod.rs
parenta01b4cc9f375f1b95fa8195daeea938d3d9c4c34 (diff)
parentaacbd8671b316a0fb79af71121d723ce25e703d2 (diff)
downloadrust-66676820eb801473f21006fa64315ce3c42402eb.tar.gz
rust-66676820eb801473f21006fa64315ce3c42402eb.zip
Auto merge of #108659 - ferrocene:pa-test-metrics, r=Mark-Simulacrum
Include executed tests in the build metrics (and use a custom test display impl)

The main goal of this PR is to include all tests executed in CI inside the build metrics JSON files. I need this for Ferrocene, and `@Mark-Simulacrum` expressed desire to have this as well to ensure all tests are executed at least once somewhere in CI.

Unfortunately implementing this required rewriting inside of bootstrap all of the code to render the test output to console. libtest supports outputting JSON instead of raw text, which we can indeed use to populate the build metrics. Doing that suppresses the console output though, and compared to rustc and Cargo the console output is not included as a JSON field.

Because of that, this PR had to reimplement both the "pretty" format (one test per line, with `rust.verbose-tests = true`), and the "terse" format (the wall of dots, with `rust.verbose-tests = false`). The current implementation should have the exact same output as libtest, except for the benchmark output. libtest's benchmark output is broken in the "terse" format, so since that's our default I slightly improved how it's rendered.

Also, to bring parity with libtest I had to introduce support for coloring output from bootstrap, using the same dependencies `annotate-snippets` uses. It's now possible to use `builder.color_for_stdout(Color::Red, "text")` and `builder.color_for_stderr(Color::Green, "text")` across all of bootstrap, automatically respecting the `--color` flag and whether the stream is a terminal or not.

I recommend reviewing the PR commit-by-commit.
r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_hir_analysis/src/coherence/mod.rs')
0 files changed, 0 insertions, 0 deletions