diff options
| author | Alex Macleod <alex@macleod.io> | 2023-07-23 17:19:52 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2023-07-24 18:29:11 +0000 |
| commit | 5c26e82d80b4c6f2f1eb54b98edd832f00cbd0a6 (patch) | |
| tree | 1654185702664b575a299ee497228c29ae09c338 | |
| parent | d2c9047a927758d6788c610d76695036ea7b57e2 (diff) | |
| download | rust-5c26e82d80b4c6f2f1eb54b98edd832f00cbd0a6.tar.gz rust-5c26e82d80b4c6f2f1eb54b98edd832f00cbd0a6.zip | |
Remove Gha status emitter in compile-test
| -rw-r--r-- | clippy_lints/src/utils/mod.rs | 2 | ||||
| -rw-r--r-- | tests/compile-test.rs | 36 |
2 files changed, 21 insertions, 17 deletions
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index fb08256931f..4fef8c0717d 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -18,7 +18,7 @@ const BOOK_CONFIGS_PATH: &str = "https://doc.rust-lang.org/clippy/lint_configura // ================================================================== // Configuration // ================================================================== -#[derive(Debug, Clone, Default)] //~ ERROR no such field +#[derive(Debug, Clone, Default)] pub struct ClippyConfiguration { pub name: String, #[allow(dead_code)] diff --git a/tests/compile-test.rs b/tests/compile-test.rs index d70c4ea34cb..596b04fe8a5 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -5,7 +5,7 @@ #![warn(rust_2018_idioms, unused_lifetimes)] #![allow(unused_extern_crates)] -use compiletest::{status_emitter, CommandBuilder}; +use compiletest::{status_emitter, CommandBuilder, OutputConflictHandling}; use ui_test as compiletest; use ui_test::Mode as TestMode; @@ -116,9 +116,9 @@ fn base_config(test_dir: &str) -> compiletest::Config { stderr_filters: vec![], stdout_filters: vec![], output_conflict_handling: if var_os("BLESS").is_some() || env::args().any(|arg| arg == "--bless") { - compiletest::OutputConflictHandling::Bless + OutputConflictHandling::Bless } else { - compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into()) + OutputConflictHandling::Error("cargo uibless".into()) }, target: None, out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap_or("target".into())).join("ui_test"), @@ -187,9 +187,6 @@ fn run_ui() { .to_string() }), ); - eprintln!(" Compiler: {}", config.program.display()); - - let name = config.root_dir.display().to_string(); let test_filter = test_filter(); @@ -197,7 +194,7 @@ fn run_ui() { config, move |path| compiletest::default_file_filter(path) && test_filter(path), compiletest::default_per_file_config, - (status_emitter::Text, status_emitter::Gha::<true> { name }), + status_emitter::Text, ) .unwrap(); check_rustfix_coverage(); @@ -208,8 +205,19 @@ fn run_internal_tests() { if !RUN_INTERNAL_TESTS { return; } - let config = base_config("ui-internal"); - compiletest::run_tests(config).unwrap(); + let mut config = base_config("ui-internal"); + if let OutputConflictHandling::Error(err) = &mut config.output_conflict_handling { + *err = "cargo uitest --features internal -- -- --bless".into(); + } + let test_filter = test_filter(); + + compiletest::run_tests_generic( + config, + move |path| compiletest::default_file_filter(path) && test_filter(path), + compiletest::default_per_file_config, + status_emitter::Text, + ) + .unwrap(); } fn run_ui_toml() { @@ -228,13 +236,11 @@ fn run_ui_toml() { "$$DIR", ); - let name = config.root_dir.display().to_string(); - let test_filter = test_filter(); ui_test::run_tests_generic( config, - |path| test_filter(path) && path.extension() == Some("rs".as_ref()), + |path| compiletest::default_file_filter(path) && test_filter(path), |config, path| { let mut config = config.clone(); config @@ -243,7 +249,7 @@ fn run_ui_toml() { .push(("CLIPPY_CONF_DIR".into(), Some(path.parent().unwrap().into()))); Some(config) }, - (status_emitter::Text, status_emitter::Gha::<true> { name }), + status_emitter::Text, ) .unwrap(); } @@ -284,8 +290,6 @@ fn run_ui_cargo() { "$$DIR", ); - let name = config.root_dir.display().to_string(); - let test_filter = test_filter(); ui_test::run_tests_generic( @@ -296,7 +300,7 @@ fn run_ui_cargo() { config.out_dir = PathBuf::from("target/ui_test_cargo/").join(path.parent().unwrap()); Some(config) }, - (status_emitter::Text, status_emitter::Gha::<true> { name }), + status_emitter::Text, ) .unwrap(); } |
