]> granicus.if.org Git - php/commitdiff
Add support for "xfail" to phpt SKIPIF sections
authorNikita Popov <nikic@php.net>
Tue, 22 Nov 2016 21:43:23 +0000 (22:43 +0100)
committerNikita Popov <nikic@php.net>
Tue, 10 Jan 2017 22:32:03 +0000 (23:32 +0100)
If SKIPIF output starts with "xfail" instead of "skip", the test
will be marked as XFAIL with the following message. Example:

    --TEST--
    Test xfailif feature
    --SKIPIF--
    <?php
    if (some_cond()) die('xfail Expected to fail!');
    ?>
    --FILE--
    ...

run-tests.php

index 14a252b934eead5cadaf8e918c2a09f2f16ff768..40162881c56ef9d9aa3947c0d91825105821cfde 100755 (executable)
@@ -1590,6 +1590,11 @@ TEST $file
                                        $info = " (warn: $m[1])";
                                }
                        }
+
+                       if (!strncasecmp('xfail', ltrim($output), 5)) {
+                               // Pretend we have an XFAIL section
+                               $section_text['XFAIL'] = trim(substr(ltrim($output), 5));
+                       }
                }
        }