-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Handle RUST_TEST_NOCAPTURE in compiletest and set add if to run env #22371
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Handle RUST_TEST_NOCAPTURE in compiletest and set add if to run env #22371
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This patch also adds |
@bors: r+ ebe7f1 rollup. Thanks! I think let's leave it requiring |
🙀 You have the wrong number! Please try again with |
@bors: r+ 9ebe7f1 rollup |
This causes a failure of run-fail/test-tasks-invalid-value.rs (http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3610/steps/test/logs/stdio) (The test itself sets the |
9ebe7f1
to
ef1308c
Compare
@ Manishearth thanks! I have updated the patch to only set |
…ture, r=Manishearth This is a patch for rust-lang#17829. In `compiletest` there are multiple layers which capture the output. The first layer is `run_tests_console` which is used to execute all tests. Then there are some tests that contain unit tests, which by default also captures output. Therefore `compiletest` adds `RUST_TEST_NOCAPTURE` (and `RUST_TEST_TASKS` for completeness) to the run environment of the task. Finally, the task used to execute a test redirects stdout and stdin. At the moment, the `VERBOSE=1` prints all captured output of the task (but has to print stdout and stderr separately). So at the moment using `RUST_TEST_NOCAPTURE=1` only makes sense when also using `VERBOSE=1` which seems a little bit cumbersome. Should I update the patch to only print the output of the tasks that actually execute the test (`VERBOSE=1` includes other stuff, like the output of the task used to compile the test)? This will probably involve adding an extra flag to some functions in `src/compiletest/runtest.rs` to distinguish compilation runs from runs that execute the actual tests.
…ture, r=Manishearth This is a patch for rust-lang#17829. In `compiletest` there are multiple layers which capture the output. The first layer is `run_tests_console` which is used to execute all tests. Then there are some tests that contain unit tests, which by default also captures output. Therefore `compiletest` adds `RUST_TEST_NOCAPTURE` (and `RUST_TEST_TASKS` for completeness) to the run environment of the task. Finally, the task used to execute a test redirects stdout and stdin. At the moment, the `VERBOSE=1` prints all captured output of the task (but has to print stdout and stderr separately). So at the moment using `RUST_TEST_NOCAPTURE=1` only makes sense when also using `VERBOSE=1` which seems a little bit cumbersome. Should I update the patch to only print the output of the tasks that actually execute the test (`VERBOSE=1` includes other stuff, like the output of the task used to compile the test)? This will probably involve adding an extra flag to some functions in `src/compiletest/runtest.rs` to distinguish compilation runs from runs that execute the actual tests.
This is a patch for #17829.
In
compiletest
there are multiple layers which capture the output. The first layer isrun_tests_console
which is used to execute all tests.Then there are some tests that contain unit tests, which by default also captures output. Therefore
compiletest
addsRUST_TEST_NOCAPTURE
(andRUST_TEST_TASKS
for completeness) to the run environment of the task.Finally, the task used to execute a test redirects stdout and stdin. At the moment, the
VERBOSE=1
prints all captured output of the task (but has to print stdout and stderr separately). So at the moment usingRUST_TEST_NOCAPTURE=1
only makes sense when also usingVERBOSE=1
which seems a little bit cumbersome.Should I update the patch to only print the output of the tasks that actually execute the test (
VERBOSE=1
includes other stuff, like the output of the task used to compile the test)? This will probably involve adding an extra flag to some functions insrc/compiletest/runtest.rs
to distinguish compilation runs from runs that execute the actual tests.