From 279f745a60f0937047b8e441347dfb98a9d97cf9 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 7 Sep 2019 22:47:07 +0200 Subject: [PATCH] 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 :( --- run-tests.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run-tests.php b/run-tests.php index 2104ab2a64c..89525f518b2 100755 --- a/run-tests.php +++ b/run-tests.php @@ -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/', '', $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'; }