Fix reporting of redirect test failures in junit

These were being reported under the wrong name ... which means that
they don't show up as failures on azure :(
This commit is contained in:
Nikita Popov 2019-09-07 22:47:07 +02:00
parent eef85229d0
commit 279f745a60

View file

@ -2037,6 +2037,7 @@ TEST $file
if (is_array($IN_REDIRECT)) {
$tested = $IN_REDIRECT['prefix'] . ' ' . trim($section_text['TEST']);
$tested_file = $tmp_relative_file;
$shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file);
}
// unlink old test results
@ -2722,7 +2723,8 @@ COMMAND $cmd
// write .diff
$diff = generate_diff($wanted, $wanted_re, $output);
if (is_array($IN_REDIRECT)) {
$diff = "# original source file: $shortname\n" . $diff;
$orig_shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $file);
$diff = "# original source file: $orig_shortname\n" . $diff;
}
show_file_block('diff', $diff);
if (strpos($log_format, 'D') !== false && file_put_contents($diff_filename, $diff, FILE_BINARY) === false) {
@ -2769,7 +2771,7 @@ $output
$diff = empty($diff) ? '' : preg_replace('/\e/', '<esc>', $diff);
junit_mark_test_as($restype, str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file), $tested, null, $info, $diff);
junit_mark_test_as($restype, $shortname, $tested, null, $info, $diff);
return $restype[0] . 'ED';
}