Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently refer to a test's revision instead of cfg #121373

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Feb 21, 2024

Compiletest allows a test file to specify multiple “revisions” (//@ revisions: foo bar), with each revision running as a separate test, and having the ability to define revision-specific headers (//@[foo] ignore-blah) and revision-specific code (#[cfg(foo)]).

The code that implements this feature sometimes uses the term “cfg” instead of “revision”. This results in two confusingly-different names for the same concept, one of which is ambiguous with other kinds of configuration (such as compiletest's own config).

This PR replaces those occurrences of cfg with revision, so that one name is used consistently.

@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2024

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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 Feb 21, 2024
@Zalathar
Copy link
Contributor Author

This inconsistency dates all the way back to #32007, when revisions were first implemented.

I can't see a good reason for having multiple terms for the same concept. Perhaps cfg was left over from an earlier design, and the implementation code wasn't fully updated afterwards (since it still worked just fine).

@jieyouxu
Copy link
Member

FYI: in #121370 I'm changing all the compiletest directives to use //@ consistently, so it would be //@ <directive-name> and //@[revision-name] <directive-name> in rest of tests/ too.

Compiletest code sometimes refers to a test's revision as its `cfg`. This
results in two different names for the same thing, one of which is ambiguous
with other kinds of configuration (such as compiletest's own config).

This patch replaces those occurrences of `cfg` with `revision`.
@Zalathar Zalathar force-pushed the test-revision branch 2 times, most recently from cb7cf3d to 544d091 Compare February 21, 2024 10:20
@Zalathar
Copy link
Contributor Author

Tweaked a couple of comments to be more forward-looking in light of #121370.

@compiler-errors
Copy link
Member

r? oli-obk

@rustbot rustbot assigned oli-obk and unassigned compiler-errors Feb 21, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Feb 21, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 21, 2024

📌 Commit 544d091 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 21, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#121206 (Top level error handling)
 - rust-lang#121261 (coverage: Remove `pending_dups` from the span refiner)
 - rust-lang#121336 (triagebot: add queue notifications)
 - rust-lang#121373 (Consistently refer to a test's `revision` instead of `cfg`)
 - rust-lang#121391 (never patterns: Fix liveness analysis in the presence of never patterns)
 - rust-lang#121392 (Unify dylib loading between proc macros and codegen backends)
 - rust-lang#121399 (Solaris linker does not support --strip-debug)
 - rust-lang#121406 (Add a couple tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 084e232 into rust-lang:master Feb 22, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2024
Rollup merge of rust-lang#121373 - Zalathar:test-revision, r=oli-obk

Consistently refer to a test's `revision` instead of `cfg`

Compiletest allows a test file to specify multiple “revisions” (`//@ revisions: foo bar`), with each revision running as a separate test, and having the ability to define revision-specific headers (`//`@[foo]` ignore-blah`) and revision-specific code (`#[cfg(foo)]`).

The code that implements this feature sometimes uses the term “cfg” instead of “revision”. This results in two confusingly-different names for the same concept, one of which is ambiguous with other kinds of configuration (such as compiletest's own config).

This PR replaces those occurrences of `cfg` with `revision`, so that one name is used consistently.
@Zalathar Zalathar deleted the test-revision branch February 22, 2024 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants