Skip to content

Commit

Permalink
Strip remote-test-client output from run stdout
Browse files Browse the repository at this point in the history
The remote-test-client outputs a message of the form "uploaded
"<build_dir>/<executable_path>", waiting for result" onto stdout when
executing a test, which is then captured in the process result. This needs to be removed when
comparing the results of the run-pass test execution.
  • Loading branch information
nathanwhit committed Sep 3, 2019
1 parent bf44f12 commit 12adc39
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2951,8 +2951,24 @@ impl<'test> TestCx<'test> {
let expected_stderr = self.load_expected_output(stderr_kind);
let expected_stdout = self.load_expected_output(stdout_kind);

let normalized_stdout =
self.normalize_output(&proc_res.stdout, &self.props.normalize_stdout);
let normalized_stdout = match output_kind {
TestOutput::Run if self.config.remote_test_client.is_some() => {
// When tests are run using the remote-test-client, the string
// 'uploaded "$TEST_BUILD_DIR/<test_executable>, waiting for result"'
// is printed to stdout by the client and then captured in the ProcRes,
// so it needs to be removed when comparing the run-pass test execution output
lazy_static! {
static ref REMOTE_TEST_RE: Regex = Regex::new(
"^uploaded \"\\$TEST_BUILD_DIR(/[[:alnum:]_\\-]+)+\", waiting for result\n"
).unwrap();
}
REMOTE_TEST_RE.replace(
&self.normalize_output(&proc_res.stdout, &self.props.normalize_stdout),
""
).to_string()
}
_ => self.normalize_output(&proc_res.stdout, &self.props.normalize_stdout)
};

let stderr = if explicit_format {
proc_res.stderr.clone()
Expand Down

0 comments on commit 12adc39

Please sign in to comment.