-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Migrate "ui" test suite from legacy compiletest-style directives //
to ui_test
-style directives //@
#120881
Conversation
602d658
to
c633baa
Compare
Lol, did rustbot just give up? |
r? @oli-obk |
I no longer have the energy to work on my efforts for that, but I have pushed the rest of my changes to my fork and this was part of an effort to allow compiletest to properly parse ui_test style headers, not just change the syntax. Feel free to use any of this code for any purpose. I think it's a better move to just move to ui_test style comments without changing the actual commands. However I would like to see a tidy warning and fix suggestion (that can auto apply on bless), to make sure that developers don't accidentally use the old style comments and the test doesn't actually test everything it's meant to. (I have some code in my branch that has tidy fixing things, for reference. However I ended up completely changing how the parsing works, so it may or may not be usable.) |
I agree that a tidy warning would be a good idea. I'm not entirely sure on the auto-apply fix suggestion though, because there might be unfortunate cases like // This comment serves to mention that
// ignore-test is a very useful directive
// which ignores the test. and then the test can become unintentionally ignored. (Even though is this the current behavior.) |
It may be simpler to parse twice, once with |
I added a very dumb check, trying to parse a |
ff1704e
to
ba9995f
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #120980) made this pull request unmergeable. Please resolve the merge conflicts. |
ba9995f
to
e6fb22f
Compare
Changes to the code generated for builtin derived traits. cc @nnethercote |
Sorry there's something weird with my diff, might have accidentally done something... |
e6fb22f
to
cbfb5e4
Compare
I can squash the commits after the relevant migration parts are reviewed. |
lgtm! Please squash. will the collect-test-directives branch still work on top of this or does it include the relevant parts to skip tidy? |
This comment was marked as outdated.
This comment was marked as outdated.
Finished benchmarking commit (bccb9bb): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 638.862s -> 639.086s (0.04%) |
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
Rollup merge of rust-lang#121233 - Zalathar:extra-directives, r=oli-obk Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of rust-lang#112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that rust-lang#120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
compiletest: Remove the one thing that was checking a directive's `original_line` This special handling of `ignore-tidy*` was introduced during the migration to `//`@`` directives (rust-lang#120881), and has become unnecessary after the subsequent removal of the legacy directive check (rust-lang#131392).
compiletest: Remove the one thing that was checking a directive's `original_line` This special handling of `ignore-tidy*` was introduced during the migration to `//`@`` directives (rust-lang#120881), and has become unnecessary after the subsequent removal of the legacy directive check (rust-lang#131392).
Rollup merge of rust-lang#131585 - Zalathar:original-line, r=jieyouxu compiletest: Remove the one thing that was checking a directive's `original_line` This special handling of `ignore-tidy*` was introduced during the migration to `//`@`` directives (rust-lang#120881), and has become unnecessary after the subsequent removal of the legacy directive check (rust-lang#131392).
Preface
There's an on-going effort to rewrite parts of or the entirety of compiletest
(rust-lang/compiler-team#536). A step towards this involve migrating
ui tests to use the
ui_test
framework, which involveschanging compiletest directives in
// <directive-name>
style toui_test
//@ <directive-name>
style (rust-lang/compiler-team#512).
This PR aims to implement the directive-style change from
//
to//@
for ui tests only andmake compiletest only accept
//@
directives in the "ui" test suite (only).Key Changes
//
directives are replaced by//@
directives.//@
directives for "ui" test suite.//
directive.Diff Generation
The diff is generated by:
//
directives in ui tests with//@
.Reproduction Steps
$RUSTC_REPO_PATH/build/x86_64-apple-darwin/test/ui/__directive_lines
and the temporary file$RUSTC_REPO_PATH/build/x86_64-apple-darwin/test/ui/__directive_lines.txt
(if you ran the collection script before).script, which outputs temporary files recording headers occuring in each ui test.
git checkout collect-test-directives
../x test tests/ui --stage 1 --force-rerun
to generate the temporaryfiles consistently.
migrate-ui-test-directives
branch.migration_config.toml
viacargo run -- generate-config
under$CWD
.manual_directives = ["// should-fail"]
inmigration_config.toml
. This is required because the collection script doesn't deal with some special meta ui tests and there are no other// should-fail
occurrences.accept
//@
directives for ui tests only.RUSTC_TEST_FAIL_FAST=1 ./x test tests/ui --stage 1 --bless
migrate-ui-test-directives
branch.Next Steps
Need to implement some kind of warning or tidy script to help contributors catch old-style
An error is emitted if a comment that could be interpreted as legacy-style test directive is encountered.// <directive-name>
directives, while only acceptingui_test
-style//@ <directive-name>
directives.
//@
headers rustc-dev-guide#1885).README.md
totests/ui
describing the directive style change.