Update UI tests which relied on old behavior of constructing a default error handler every time

`early_warn` is called

Skip `colored-session-opt-error.rs` on Windows hosts

This is very cursed as to why it fails on Windows CI specifically:

- The test emits a *warning*.
- *Warnings*, and only warnings *specifically*, have a different
  256-color between Windows and non-Windows hosts (other levels
  `set_intense(true)` unconditionally):

  e69c7306e2/compiler/rustc_errors/src/lib.rs (L1792-L1794)

Therefore, I added `// ignore-windows` test header to skip this test on
Windows (it's sufficient to test color is enabled on at least one
non-Windows host).
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2023-06-29 01:32:31 +08:00
parent 53245a17bb
commit 1faa95d289
No known key found for this signature in database
GPG Key ID: C5FD5D32014FDB47
8 changed files with 8 additions and 7 deletions

View File

@ -1,3 +1,3 @@
// compile-flags: --cfg a(b=c)
// compile-flags: --error-format=human --cfg a(b=c)
// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
fn main() {}

View File

@ -1,3 +1,3 @@
// compile-flags: --cfg a{b}
// compile-flags: --error-format=human --cfg a{b}
// error-pattern: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
fn main() {}

View File

@ -1,3 +1,3 @@
// compile-flags: --cfg a(b)
// compile-flags: --error-format=human --cfg a(b)
// error-pattern: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
fn main() {}

View File

@ -1,3 +1,3 @@
// compile-flags: --cfg a{
// compile-flags: --error-format=human --cfg a{
// error-pattern: invalid `--cfg` argument: `a{` (expected `key` or `key="value"`)
fn main() {}

View File

@ -1,3 +1,3 @@
// compile-flags: --cfg )
// compile-flags: --error-format=human --cfg )
// error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`)
fn main() {}

View File

@ -1,4 +1,4 @@
// Test for missing quotes around value, issue #66450.
// compile-flags: --cfg key=value
// compile-flags: --error-format=human --cfg key=value
// error-pattern: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
fn main() {}

View File

@ -1,6 +1,6 @@
// Tests that empty source_maps don't ICE (#23301)
// compile-flags: --cfg ""
// compile-flags: --error-format=human --cfg ""
// error-pattern: invalid `--cfg` argument: `""` (expected `key` or `key="value"`)

View File

@ -1,3 +1,4 @@
// check-pass
// ignore-windows
// compile-flags: -Cremark=foo --error-format=human --color always
fn main() {}