]> git.lizzy.rs Git - rust.git/commit - src/tools/rustfmt
Auto merge of #78752 - jyn514:html-diff, r=GuillaumeGomez
authorbors <bors@rust-lang.org>
Sun, 22 Nov 2020 01:09:04 +0000 (01:09 +0000)
committerbors <bors@rust-lang.org>
Sun, 22 Nov 2020 01:09:04 +0000 (01:09 +0000)
commit70090118c281ea7dba2e6093462d8ae0e1fa7195
tree4d00450fe6416fb42524aa73228d5de7188e50e5
parenta1a13b2bc4fa6370b9501135d97c5fe0bc401894
parent25a3ffe5d4768e37fe98c9637db84af4714549d4
Auto merge of #78752 - jyn514:html-diff, r=GuillaumeGomez

Give a better error when rustdoc tests fail

- Run the default rustdoc against the current rustdoc
- Diff output recursively
- Colorize diff output

Closes https://github.com/rust-lang/rust/issues/78750.

## Resolved questions

- Should this be opt-in instead of on by default?
  + No
- Should this call through to `delta`? That's not a very common program to have installed, but I'm not sure how to do diffs after the fact. Maybe `compiletest` can take a `--syntax-highlighter` parameter or something?
  + I decided to use `delta` if available and `diff --color` otherwise. It prints a warning if delta isn't installed so you know you can get nicer diffs

## Open questions.

- What version of rustdoc would this compare against? Ideally it would compare against `$(git merge-base HEAD origin/master)` - maybe that's feasible if we install those artifacts from CI?
- Does it always make sense to compare the tests? Especially for new tests, I'm not sure how useful it would be ... but then again, one of the questions I want to know most as a reviewer is 'did it break before?'.

r? `@GuillaumeGomez`
cc `@Mark-Simulacrum`
src/tools/compiletest/src/runtest.rs