mirror of
https://github.com/kbwo/testing-language-server.git
synced 2025-07-24 11:23:42 +00:00
feat(cargo-test): handle --nocapture
option
This commit is contained in:
parent
7563cd801c
commit
115cca2ecf
1 changed files with 4 additions and 2 deletions
|
@ -79,10 +79,12 @@ impl Runner for CargoTestRunner {
|
|||
let output = test_result;
|
||||
write_result_log("cargo_test.log", &output)?;
|
||||
let Output { stdout, stderr, .. } = output;
|
||||
if stdout.is_empty() && !stderr.is_empty() {
|
||||
if stdout.is_empty() {
|
||||
return Err(LSError::Adapter(String::from_utf8(stderr).unwrap()));
|
||||
}
|
||||
let test_result = String::from_utf8(stdout)?;
|
||||
// When `--nocapture` option is set, stderr has some important information
|
||||
// to parse test result
|
||||
let test_result = String::from_utf8(stderr)? + &String::from_utf8(stdout)?;
|
||||
let diagnostics: RunFileTestResult = parse_diagnostics(
|
||||
&test_result,
|
||||
PathBuf::from_str(&workspace_root).unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue