]> granicus.if.org Git - php/commitdiff
Don't treat warnings as failures in the junit output
authorMatteo Beccati <mbeccati@php.net>
Wed, 29 Oct 2014 13:32:41 +0000 (14:32 +0100)
committerMatteo Beccati <mbeccati@php.net>
Wed, 29 Oct 2014 13:34:48 +0000 (14:34 +0100)
This matches Travis and the actual return code.

run-tests.php

index 4f29345d9fddc6f1ae62ef0574c2e84a1fbe8f9f..17930b29bc11699851466e94b02fb533ee1cd8d6 100755 (executable)
@@ -2724,7 +2724,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
 
        if (is_array($type)) {
                $output_type = $type[0] . 'ED';
-               $temp = array_intersect(array('XFAIL', 'FAIL'), $type);
+               $temp = array_intersect(array('XFAIL', 'FAIL', 'WARN'), $type);
                $type = reset($temp);
        } else {
                $output_type = $type . 'ED';
@@ -2738,6 +2738,9 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
        } elseif ('SKIP' == $type) {
                junit_suite_record($suite, 'test_skip');
                $JUNIT['files'][$file_name]['xml'] .= "<skipped>$escaped_message</skipped>\n";
+       } elseif ('WARN' == $type) {
+               junit_suite_record($suite, 'test_warn');
+               $JUNIT['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n";
        } elseif('FAIL' == $type) {
                junit_suite_record($suite, 'test_fail');
                $JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$escaped_message'>$escaped_details</failure>\n";