Skip to content

Support individual files for clippy tests #104200

Description

@jyn514

Clippy is a special snowflake and uses TESTNAME to tell it how to run individual tests instead of an argument to compiletest. Currently the only way to run individual tests is with TESTNAME=ice-6250 x test src/tools/clippy --bless. We should support x test src/tools/clippy/tests/ice-6250.rs as well.

#103266 will help simplify this a little by supporting the same test arguments as in-tree compiletest, but it won't solve suite paths automatically. Suite code lives around https://github.com/rust-lang/rust/blob/51de2387dc8b0871a7bbb58f0c73ea7ca1d339e4/src/bootstrap/builder.rs#L480 - maybe we need to change impl Step for Clippy to use suite_path?

Originally posted by @jyn514 in #103636 (comment)

Activity

  1. added
    A-testsuiteArea: The testsuite used to check the correctness of rustc
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Nov 9, 2022
  2. est31 commented on Nov 10, 2022

    @est31
    Member

    FTR this is also badly documented in clippy itself. You can't find it in the contributor instructions for example. It's also not printed by compiletest when it says "if you want to re-run the test do X" (that gives you a wrong command).

  3. jyn514 commented on Nov 10, 2022

    @jyn514
    MemberAuthor

    @est31 you should report that on the clippy repo.

  4. est31 commented on Nov 10, 2022

    @est31
    Member
  5. added
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Nov 17, 2022
  6. reez12g commented on Jan 3, 2023

    @reez12g
    Contributor

    @rustbot claim

  7. jieyouxu commented on Feb 19, 2025

    @jieyouxu
    Member

    Triage: clippy no longer uses compiletest (it uses ui_test now I think), but still uses TESTNAME.

  8. jieyouxu commented on Feb 22, 2025

    @jieyouxu
    Member

    Clippy is a special snowflake and uses TESTNAME to tell it how to run individual tests instead of an argument to compiletest. Currently the only way to run individual tests is with TESTNAME=ice-6250 x test src/tools/clippy --bless. We should support x test src/tools/clippy/tests/ice-6250.rs as well.

    #103266 will help simplify this a little by supporting the same test arguments as in-tree compiletest, but it won't solve suite paths automatically. Suite code lives around 51de238/src/bootstrap/builder.rs#L480 - maybe we need to change impl Step for Clippy to use suite_path?

    IIRC suite_path is only really meant for compiletest, and this might be tricky because clippy isn't using compiletest.

  9. added
    E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.
    and removed
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    on Feb 22, 2025
  10. bit-aloo commented on Feb 28, 2025

    @bit-aloo
    Member

    @rustbot claim

  11. xtexx commented on May 24, 2025

    @xtexx
    Contributor

    @rustbot claim

  12. assigned and unassigned on May 24, 2025
  13. added a commit that references this issue on May 25, 2025
  14. added a commit that references this issue on May 25, 2025
  15. added
    T-clippyRelevant to the Clippy team.
    and removed on Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-testsuiteArea: The testsuite used to check the correctness of rustcE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-clippyRelevant to the Clippy team.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions