Skip to content

Conversation

@Zalathar
Copy link
Member

Compiletest has historically handled ignore-* and only-* directives in an extremely confusing way that makes the code hard to understand and hard to modify.

This PR therefore takes an important step away from that older design by instead evaluating a set of named boolean "conditions" in advance, and then using those conditions to help determine whether a particular directive should cause its test to be ignored or not.

As usual, there's more cleanup that I want to do here, but I've left most of it for future work to help keep this PR manageable.

r? jieyouxu

The binary crate is a tiny stub; all of the logic and tests should be in the
library crate.

Disabling unit tests for the binary crate makes `x test compiletest` less
noisy.
@rustbot
Copy link
Collaborator

rustbot commented Nov 30, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 30, 2025
This commit also renames the confusing `NotADirective` outcome, and fuses it
with `External` into a single `NotHandledHere` outcome.
@Zalathar Zalathar force-pushed the prepared-conditions branch from fc681fa to b08a5fd Compare November 30, 2025 03:45
@Zalathar
Copy link
Member Author

Zalathar commented Dec 1, 2025

In the future, we should probably move towards a system where all supported ignore/only conditions are listed explicitly, and only use the all_ collections to double-check those explicitly listed condition names.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good, just one comment nit.

View changes since this review

@jieyouxu
Copy link
Member

jieyouxu commented Dec 1, 2025

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2025
@Zalathar Zalathar force-pushed the prepared-conditions branch from b08a5fd to b03a655 Compare December 1, 2025 13:15
@Zalathar
Copy link
Member Author

Zalathar commented Dec 1, 2025

Added a note about condition name overlap.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 1, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Dec 1, 2025

Thanks, you can r=me once PR CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants