Auto merge of #8304 - camsteffen:test-tweaks, r=flip1995
Remove __CLIPPY_INTERNAL_TESTS env var changelog: none It doesn't have any effect AFAICT.
This commit is contained in:
commit
0b143e347c
@ -7,7 +7,6 @@ pub fn run(filename: &str) {
|
|||||||
.args(["-Z", "no-codegen"])
|
.args(["-Z", "no-codegen"])
|
||||||
.args(["--edition", "2021"])
|
.args(["--edition", "2021"])
|
||||||
.arg(filename)
|
.arg(filename)
|
||||||
.env("__CLIPPY_INTERNAL_TESTS", "true")
|
|
||||||
.status()
|
.status()
|
||||||
.expect("failed to run cargo")
|
.expect("failed to run cargo")
|
||||||
.code();
|
.code();
|
||||||
|
@ -331,11 +331,10 @@ pub fn main() {
|
|||||||
// - IF Clippy is run on the main crate, not on deps (`!cap_lints_allow`) THEN
|
// - IF Clippy is run on the main crate, not on deps (`!cap_lints_allow`) THEN
|
||||||
// - IF `--no-deps` is not set (`!no_deps`) OR
|
// - IF `--no-deps` is not set (`!no_deps`) OR
|
||||||
// - IF `--no-deps` is set and Clippy is run on the specified primary package
|
// - IF `--no-deps` is set and Clippy is run on the specified primary package
|
||||||
let clippy_tests_set = env::var("__CLIPPY_INTERNAL_TESTS").map_or(false, |val| val == "true");
|
|
||||||
let cap_lints_allow = arg_value(&orig_args, "--cap-lints", |val| val == "allow").is_some();
|
let cap_lints_allow = arg_value(&orig_args, "--cap-lints", |val| val == "allow").is_some();
|
||||||
let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
|
let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
|
||||||
|
|
||||||
let clippy_enabled = clippy_tests_set || (!cap_lints_allow && (!no_deps || in_primary_package));
|
let clippy_enabled = !cap_lints_allow && (!no_deps || in_primary_package);
|
||||||
if clippy_enabled {
|
if clippy_enabled {
|
||||||
args.extend(clippy_args);
|
args.extend(clippy_args);
|
||||||
}
|
}
|
||||||
|
@ -328,15 +328,9 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_env() {
|
|
||||||
set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
|
|
||||||
set_var("__CLIPPY_INTERNAL_TESTS", "true");
|
|
||||||
//set_var("RUST_BACKTRACE", "0");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_test() {
|
fn compile_test() {
|
||||||
prepare_env();
|
set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
|
||||||
let mut config = default_config();
|
let mut config = default_config();
|
||||||
run_ui(&mut config);
|
run_ui(&mut config);
|
||||||
run_ui_test(&mut config);
|
run_ui_test(&mut config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user