Skip to content

Commit

Permalink
Remove $DIR replacement in test output
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Feb 17, 2024
1 parent 5471e06 commit 1d107ab
Show file tree
Hide file tree
Showing 929 changed files with 9,157 additions and 9,158 deletions.
4 changes: 2 additions & 2 deletions .github/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test "$sysroot" = $desired_sysroot
)

# Check that the --sysroot argument is only passed once via arg_file.txt (SYSROOT is ignored)
(
(
echo "fn main() {}" > target/driver_test.rs
echo "--sysroot="$(./target/debug/clippy-driver --print sysroot)"" > arg_file.txt
echo "--verbose" >> arg_file.txt
Expand All @@ -45,7 +45,7 @@ unset CARGO_MANIFEST_DIR
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
# FIXME: How to match the clippy invocation in compile-test.rs?
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/double_neg.rs 2>double_neg.stderr && exit 1
sed -e "s,tests/ui,\$DIR," -e "/= help: for/d" double_neg.stderr > normalized.stderr
sed -e "/= help: for/d" double_neg.stderr > normalized.stderr
diff -u normalized.stderr tests/ui/double_neg.stderr

# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
Expand Down
1 change: 0 additions & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ fn base_config(test_dir: &str) -> (Config, Args) {
}))
.into();
config.comment_defaults.base().diagnostic_code_prefix = Some(Spanned::dummy("clippy::".into())).into();
config.filter(&format!("tests/{test_dir}"), "$$DIR");
config.with_args(&args);
let current_exe_path = env::current_exe().unwrap();
let deps_path = current_exe_path.parent().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-cargo/multiple_config_files/warn/Cargo.stderr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
warning: using config file `$DIR/$DIR/multiple_config_files/warn/.clippy.toml`, `$DIR/$DIR/multiple_config_files/warn/clippy.toml` will be ignored
warning: using config file `$DIR/tests/ui-cargo/multiple_config_files/warn/.clippy.toml`, `$DIR/tests/ui-cargo/multiple_config_files/warn/clippy.toml` will be ignored

10 changes: 5 additions & 5 deletions tests/ui-internal/check_clippy_version_attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this item has an invalid `clippy::version` attribute
--> $DIR/check_clippy_version_attribute.rs:40:1
--> tests/ui-internal/check_clippy_version_attribute.rs:40:1
|
LL | / declare_tool_lint! {
LL | | #[clippy::version = "1.2.3.4.5.6"]
Expand All @@ -12,15 +12,15 @@ LL | | }
|
= help: please use a valid semantic version, see `doc/adding_lints.md`
note: the lint level is defined here
--> $DIR/check_clippy_version_attribute.rs:1:9
--> tests/ui-internal/check_clippy_version_attribute.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::invalid_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: this item has an invalid `clippy::version` attribute
--> $DIR/check_clippy_version_attribute.rs:48:1
--> tests/ui-internal/check_clippy_version_attribute.rs:48:1
|
LL | / declare_tool_lint! {
LL | | #[clippy::version = "I'm a string"]
Expand All @@ -35,7 +35,7 @@ LL | | }
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: this lint is missing the `clippy::version` attribute or version value
--> $DIR/check_clippy_version_attribute.rs:59:1
--> tests/ui-internal/check_clippy_version_attribute.rs:59:1
|
LL | / declare_tool_lint! {
LL | | #[clippy::version]
Expand All @@ -51,7 +51,7 @@ LL | | }
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: this lint is missing the `clippy::version` attribute or version value
--> $DIR/check_clippy_version_attribute.rs:67:1
--> tests/ui-internal/check_clippy_version_attribute.rs:67:1
|
LL | / declare_tool_lint! {
LL | | pub clippy::MISSING_ATTRIBUTE_TWO,
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/check_formulation.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: non-standard lint formulation
--> $DIR/check_formulation.rs:23:5
--> tests/ui-internal/check_formulation.rs:23:5
|
LL | /// Check for lint formulations that are correct
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -9,7 +9,7 @@ LL | /// Check for lint formulations that are correct
= help: to override `-D warnings` add `#[allow(clippy::almost_standard_lint_formulation)]`

error: non-standard lint formulation
--> $DIR/check_formulation.rs:33:5
--> tests/ui-internal/check_formulation.rs:33:5
|
LL | /// Detects uses of incorrect formulations
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
12 changes: 6 additions & 6 deletions tests/ui-internal/collapsible_span_lint_calls.stderr
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
error: this call is collapsible
--> $DIR/collapsible_span_lint_calls.rs:35:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:35:9
|
LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
LL | | db.span_suggestion(expr.span, help_msg, sugg.to_string(), Applicability::MachineApplicable);
LL | | });
| |__________^ help: collapse into: `span_lint_and_sugg(cx, TEST_LINT, expr.span, lint_msg, help_msg, sugg.to_string(), Applicability::MachineApplicable)`
|
note: the lint level is defined here
--> $DIR/collapsible_span_lint_calls.rs:1:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::collapsible_span_lint_calls)]` implied by `#[deny(clippy::internal)]`

error: this call is collapsible
--> $DIR/collapsible_span_lint_calls.rs:38:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:38:9
|
LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
LL | | db.span_help(expr.span, help_msg);
LL | | });
| |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), help_msg)`

error: this call is collapsible
--> $DIR/collapsible_span_lint_calls.rs:41:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:41:9
|
LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
LL | | db.help(help_msg);
LL | | });
| |__________^ help: collapse into: `span_lint_and_help(cx, TEST_LINT, expr.span, lint_msg, None, help_msg)`

error: this call is collapsible
--> $DIR/collapsible_span_lint_calls.rs:44:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:44:9
|
LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
LL | | db.span_note(expr.span, note_msg);
LL | | });
| |__________^ help: collapse into: `span_lint_and_note(cx, TEST_LINT, expr.span, lint_msg, Some(expr.span), note_msg)`

error: this call is collapsible
--> $DIR/collapsible_span_lint_calls.rs:47:9
--> tests/ui-internal/collapsible_span_lint_calls.rs:47:9
|
LL | / span_lint_and_then(cx, TEST_LINT, expr.span, lint_msg, |db| {
LL | | db.note(note_msg);
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/default_deprecation_reason.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the lint `COOL_LINT_DEFAULT` has the default deprecation reason
--> $DIR/default_deprecation_reason.rs:8:1
--> tests/ui-internal/default_deprecation_reason.rs:8:1
|
LL | / declare_deprecated_lint! {
LL | | /// ### What it does
Expand All @@ -11,7 +11,7 @@ LL | | }
| |_^
|
note: the lint level is defined here
--> $DIR/default_deprecation_reason.rs:1:9
--> tests/ui-internal/default_deprecation_reason.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/default_lint.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the lint `TEST_LINT_DEFAULT` has the default lint description
--> $DIR/default_lint.rs:18:1
--> tests/ui-internal/default_lint.rs:18:1
|
LL | / declare_tool_lint! {
LL | | pub clippy::TEST_LINT_DEFAULT,
Expand All @@ -10,7 +10,7 @@ LL | | }
| |_^
|
note: the lint level is defined here
--> $DIR/default_lint.rs:1:9
--> tests/ui-internal/default_lint.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/disallow_span_lint.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: use of a disallowed method `rustc_lint::context::LintContext::span_lint`
--> $DIR/disallow_span_lint.rs:14:5
--> tests/ui-internal/disallow_span_lint.rs:14:5
|
LL | cx.span_lint(lint, span, msg, |_| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | cx.span_lint(lint, span, msg, |_| {});
= help: to override `-D warnings` add `#[allow(clippy::disallowed_methods)]`

error: use of a disallowed method `rustc_middle::ty::context::TyCtxt::node_span_lint`
--> $DIR/disallow_span_lint.rs:24:5
--> tests/ui-internal/disallow_span_lint.rs:24:5
|
LL | tcx.node_span_lint(lint, hir_id, span, msg, |_| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
10 changes: 5 additions & 5 deletions tests/ui-internal/interning_defined_symbol.stderr
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
error: interning a defined symbol
--> $DIR/interning_defined_symbol.rs:17:13
--> tests/ui-internal/interning_defined_symbol.rs:17:13
|
LL | let _ = Symbol::intern("f32");
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::f32`
|
note: the lint level is defined here
--> $DIR/interning_defined_symbol.rs:1:9
--> tests/ui-internal/interning_defined_symbol.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::interning_defined_symbol)]` implied by `#[deny(clippy::internal)]`

error: interning a defined symbol
--> $DIR/interning_defined_symbol.rs:20:13
--> tests/ui-internal/interning_defined_symbol.rs:20:13
|
LL | let _ = sym!(f32);
| ^^^^^^^^^ help: try: `rustc_span::sym::f32`

error: interning a defined symbol
--> $DIR/interning_defined_symbol.rs:23:13
--> tests/ui-internal/interning_defined_symbol.rs:23:13
|
LL | let _ = Symbol::intern("proc-macro");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::sym::proc_dash_macro`

error: interning a defined symbol
--> $DIR/interning_defined_symbol.rs:26:13
--> tests/ui-internal/interning_defined_symbol.rs:26:13
|
LL | let _ = Symbol::intern("self");
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `rustc_span::symbol::kw::SelfLower`
Expand Down
6 changes: 3 additions & 3 deletions tests/ui-internal/invalid_msrv_attr_impl.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: `extract_msrv_attr!` macro missing from `LateLintPass` implementation
--> $DIR/invalid_msrv_attr_impl.rs:28:1
--> tests/ui-internal/invalid_msrv_attr_impl.rs:28:1
|
LL | impl LateLintPass<'_> for Pass {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/invalid_msrv_attr_impl.rs:1:9
--> tests/ui-internal/invalid_msrv_attr_impl.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
Expand All @@ -17,7 +17,7 @@ LL + extract_msrv_attr!(LateContext);
|

error: `extract_msrv_attr!` macro missing from `EarlyLintPass` implementation
--> $DIR/invalid_msrv_attr_impl.rs:32:1
--> tests/ui-internal/invalid_msrv_attr_impl.rs:32:1
|
LL | impl EarlyLintPass for Pass {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions tests/ui-internal/invalid_paths.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: invalid path
--> $DIR/invalid_paths.rs:15:5
--> tests/ui-internal/invalid_paths.rs:15:5
|
LL | pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,13 +8,13 @@ LL | pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"
= help: to override `-D warnings` add `#[allow(clippy::invalid_paths)]`

error: invalid path
--> $DIR/invalid_paths.rs:18:5
--> tests/ui-internal/invalid_paths.rs:18:5
|
LL | pub const BAD_CRATE_PATH: [&str; 2] = ["bad", "path"];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: invalid path
--> $DIR/invalid_paths.rs:21:5
--> tests/ui-internal/invalid_paths.rs:21:5
|
LL | pub const BAD_MOD_PATH: [&str; 2] = ["std", "xxx"];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/lint_without_lint_pass.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the lint `TEST_LINT` is not added to any `LintPass`
--> $DIR/lint_without_lint_pass.rs:12:1
--> tests/ui-internal/lint_without_lint_pass.rs:12:1
|
LL | / declare_tool_lint! {
LL | | pub clippy::TEST_LINT,
Expand All @@ -10,7 +10,7 @@ LL | | }
| |_^
|
note: the lint level is defined here
--> $DIR/lint_without_lint_pass.rs:1:9
--> tests/ui-internal/lint_without_lint_pass.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-internal/outer_expn_data.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: usage of `outer_expn().expn_data()`
--> $DIR/outer_expn_data.rs:23:34
--> tests/ui-internal/outer_expn_data.rs:23:34
|
LL | let _ = expr.span.ctxt().outer_expn().expn_data();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `outer_expn_data()`
|
note: the lint level is defined here
--> $DIR/outer_expn_data.rs:1:9
--> tests/ui-internal/outer_expn_data.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit 1d107ab

Please sign in to comment.