Skip to content

Commit 12adc39

Browse files
committed
Strip remote-test-client output from run stdout
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.
1 parent bf44f12 commit 12adc39

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/tools/compiletest/src/runtest.rs

+18-2
Original file line numberDiff line numberDiff line change
@@ -2951,8 +2951,24 @@ impl<'test> TestCx<'test> {
29512951
let expected_stderr = self.load_expected_output(stderr_kind);
29522952
let expected_stdout = self.load_expected_output(stdout_kind);
29532953

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

29572973
let stderr = if explicit_format {
29582974
proc_res.stderr.clone()

0 commit comments

Comments
 (0)