Rollup merge of #152658 - scrabsha:normalize-before-svg, r=jieyouxu
compiletest: normalize stderr before SVG rendering Element position is hardcoded in the rendered SVG. This means that any change in element length (for instance, when substituting the path with the `rust` checkout with `$DIR`) would not change the position and result in buggy SVG being generated. Normalizing before SVG rendering allows us to keep a consistent element placement.
This commit is contained in:
commit
cf32cab26c
1 changed files with 15 additions and 8 deletions
|
|
@ -2384,15 +2384,22 @@ impl<'test> TestCx<'test> {
|
|||
_ => {}
|
||||
};
|
||||
|
||||
let stderr = if self.force_color_svg() {
|
||||
anstyle_svg::Term::new().render_svg(&proc_res.stderr)
|
||||
} else if explicit_format {
|
||||
proc_res.stderr.clone()
|
||||
} else {
|
||||
json::extract_rendered(&proc_res.stderr)
|
||||
};
|
||||
let stderr;
|
||||
let normalized_stderr;
|
||||
|
||||
if self.force_color_svg() {
|
||||
let normalized = self.normalize_output(&proc_res.stderr, &self.props.normalize_stderr);
|
||||
stderr = anstyle_svg::Term::new().render_svg(&normalized);
|
||||
normalized_stderr = stderr.clone();
|
||||
} else {
|
||||
stderr = if explicit_format {
|
||||
proc_res.stderr.clone()
|
||||
} else {
|
||||
json::extract_rendered(&proc_res.stderr)
|
||||
};
|
||||
normalized_stderr = self.normalize_output(&stderr, &self.props.normalize_stderr);
|
||||
}
|
||||
|
||||
let normalized_stderr = self.normalize_output(&stderr, &self.props.normalize_stderr);
|
||||
let mut errors = 0;
|
||||
match output_kind {
|
||||
TestOutput::Compile => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue