-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add --pass $mode
to compiletest through ./x.py
#61755
Conversation
It's an open question what exactly "no codegen" option should be used for
|
--force check
to compiletest through ./x.py
--pass check
to compiletest through ./x.py
@petrochenkov Fixed the comments :) |
This comment has been minimized.
This comment has been minimized.
OK Let's wait for #61778 to land first. |
22c4a9e
to
57b6a20
Compare
Squashed the commits a bit. |
This comment has been minimized.
This comment has been minimized.
compiletest: Introduce `// {check,build,run}-pass` pass modes Pass UI tests now have three modes ``` // check-pass // build-pass // run-pass ``` mirroring equivalent well-known `cargo` commands. `// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases). `// build-pass` will compile and link the test without running it. `// run-pass` will compile, link and run the test. Tests without a "pass" annotation are still considered "fail" tests. Most UI tests would probably want to switch to `check-pass`. Tests validating codegen would probably want to run the generated code as well and use `run-pass`. `build-pass` should probably be rare (linking tests?). rust-lang#61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way. Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test. Perhaps some secondary CI can verify this invariant, but that's not super urgent. `// compile-pass` still works and is equivalent to `build-pass`. Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command. It can be removed some time in the future in a separate PR. cc rust-lang#61712
compiletest: Introduce `// {check,build,run}-pass` pass modes Pass UI tests now have three modes ``` // check-pass // build-pass // run-pass ``` mirroring equivalent well-known `cargo` commands. `// check-pass` will compile the test skipping codegen (which is expensive and isn't supposed to fail in most cases). `// build-pass` will compile and link the test without running it. `// run-pass` will compile, link and run the test. Tests without a "pass" annotation are still considered "fail" tests. Most UI tests would probably want to switch to `check-pass`. Tests validating codegen would probably want to run the generated code as well and use `run-pass`. `build-pass` should probably be rare (linking tests?). #61755 will provide a way to run the tests with any mode, e.g. bump `check-pass` tests to `run-pass` to satisfy especially suspicious people, and be able to make sure that codegen doesn't breaks in some entirely unexpected way. Tests marked with any mode are expected to pass with any other mode, if that's not the case for some legitimate reason, then the test should be made a "fail" test rather than a "pass" test. Perhaps some secondary CI can verify this invariant, but that's not super urgent. `// compile-pass` still works and is equivalent to `build-pass`. Why is `// compile-pass` bad - 1) it gives an impression that the test is only compiled, but not linked, 2) it doesn't mirror a cargo command. It can be removed some time in the future in a separate PR. cc #61712
…petrochenkov Add `--pass $mode` to compiletest through `./x.py` Adds a flag `--pass $mode` to compiletest, which is exposed through `./x.py`. When `--pass $mode` is passed, `{check,build,compile,run}-pass` tests will be forced to run under the given `$mode` unless the directive `// ignore-pass` exists in the test file. The modes are explained in rust-lang#61778: - `check` has the same effect as `cargo check` - `build` or `compile` have the same effect as `cargo build` - `run` has the same effect as `cargo run` On my machine, `./x.py -i test src/test/run-pass --stage 1 --pass check` takes 38 seconds whereas it takes 2 min 7 seconds without `--pass check`. cc rust-lang#61712 r? @petrochenkov
This does not, however, give me the option to "filter" by mode, right? Say I wanted to only run non-pass tests, or only run *-pass tests? |
@RalfJung |
I do agree |
Rollup of 7 pull requests Successful merges: - #61199 (Revert "Set test flag when rustdoc is running with --test option" ) - #61755 (Add `--pass $mode` to compiletest through `./x.py`) - #61818 (Issue #60709 test) - #62023 (publish_toolstate: don't use 'new' from inside the loop) - #62104 (Inform the query system about properties of queries at compile time) - #62163 (Avoid mem::uninitialized() in std::sys::unix) - #62204 (doc(libcore) Fix CS) Failed merges: r? @ghost
Adds a flag
--pass $mode
to compiletest, which is exposed through./x.py
.When
--pass $mode
is passed,{check,build,compile,run}-pass
tests will be forced to run under the given$mode
unless the directive// ignore-pass
exists in the test file.The modes are explained in #61778:
check
has the same effect ascargo check
build
orcompile
have the same effect ascargo build
run
has the same effect ascargo run
On my machine,
./x.py -i test src/test/run-pass --stage 1 --pass check
takes 38 seconds whereas it takes 2 min 7 seconds without--pass check
.cc #61712
r? @petrochenkov