-
Notifications
You must be signed in to change notification settings - Fork 13k
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
extra: Capture stdout/stderr of tests by default #12215
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With this test: #[test]
fn test1() {
fail!()
}
#[test]
fn test2() {
}
#[test]
#[should_fail]
fn test3() {
fail!()
}
#[test]
#[should_fail]
fn test4() {
} BEFORE
AFTER
|
if stdout.len() > 0 { | ||
fail_out.push_str(format!("---- {} stdout ----\n\t", | ||
f.name.to_str())); | ||
let output = str::from_utf8(*stdout).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from_utf8_lossy
seems like it'd make more sense here.
Updated with |
👌 |
When tests fail, their stdout and stderr is printed as part of the summary, but this helps suppress failure messages from #[should_fail] tests and generally clean up the output of the test runner.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
…ion-in-vscode-settings, r=Veykril feat: Support variable substitution in VSCode settings Currently support a subset of [variables provided by VSCode](https://code.visualstudio.com/docs/editor/variables-reference) in `server.extraEnv` section of Rust-Analyzer settings: * `workspaceFolder` * `workspaceFolderBasename` * `cwd` * `execPath` * `pathSeparator` Also, this PR adds support for general environment variables resolution. You can declare environment variables and reference them from other variables like this: ```JSON "rust-analyzer.server.extraEnv": { "RUSTFLAGS": "-L${env:OPEN_XR_SDK_PATH}", "OPEN_XR_SDK_PATH": "${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release" }, ``` The order of variable declaration doesn't matter, you can reference variables before defining them. If the variable is not present in `extraEnv` section, VSCode will search for them in your environment. Missing variables will be replaced with empty string. Circular references won't be resolved and will be passed to rust-analyzer server process as is. Closes rust-lang#9626, but doesn't address use cases where people want to use values provided by `rustc` or `cargo`, such as `${targetTriple}` proposal rust-lang#11649
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When tests fail, their stdout and stderr is printed as part of the summary, but
this helps suppress failure messages from #[should_fail] tests and generally
clean up the output of the test runner.