zoe Sun May 25 16:12:28 2008 UTC Modified files: /php-src run-tests.php Log: Added --XFAIL-- section http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.347&r2=1.348&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.347 php-src/run-tests.php:1.348 --- php-src/run-tests.php:1.347 Wed May 21 14:01:31 2008 +++ php-src/run-tests.php Sun May 25 16:12:27 2008 @@ -24,7 +24,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: run-tests.php,v 1.347 2008/05/21 14:01:31 felipe Exp $ */ +/* $Id: run-tests.php,v 1.348 2008/05/25 16:12:27 zoe Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -251,7 +251,7 @@ $test_files = array(); $redir_tests = array(); $test_results = array(); -$PHP_FAILED_TESTS = array('BORKED' => array(), 'FAILED' => array(), 'WARNED' => array(), 'LEAKED' => array()); +$PHP_FAILED_TESTS = array('BORKED' => array(), 'FAILED' => array(), 'WARNED' => array(), 'LEAKED' => array(), 'XFAILED' => array()); // If parameters given assume they represent selected tests to run. $failed_tests_file= false; @@ -447,7 +447,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.347 $'."\n"; + echo '$Revision: 1.348 $'."\n"; exit(1); default: echo "Illegal switch specified!\n"; @@ -717,7 +717,7 @@ /* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */ if (!getenv('NO_INTERACTION')) { $fp = fopen("php://stdin", "r+"); - if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED']) { + if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED']|| $sum_results['XFAILED']) { echo "\nYou may have found a problem in PHP."; } echo "\nWe would like to send this report automatically to the\n"; @@ -996,7 +996,7 @@ { $pu = $unicode_and_native && $unicode_semantics ? '.u' : ''; $test_results[$index.$pu] = $result; - if ($failed_tests_file && ($result == 'FAILED' || $result == 'WARNED' || $result == 'LEAKED')) + if ($failed_tests_file && ($result== 'XFAILED' || $result == 'FAILED' || $result == 'WARNED' || $result == 'LEAKED')) { fwrite($failed_tests_file, "$index\n"); } @@ -1693,7 +1693,11 @@ $restype[] = 'WARN'; } if (!$passed) { - $restype[] = 'FAIL'; + if(isset($section_text['XFAIL'])) { + $restype[] = 'XFAIL'; + }else{ + $restype[] = 'FAIL'; + } } if (!$passed) { @@ -1907,7 +1911,7 @@ $n_total = count($test_results); $n_total += $ignored_by_ext; - $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0, 'BORKED'=>0, 'LEAKED'=>0); + $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0, 'BORKED'=>0, 'LEAKED'=>0, 'XFAILED' => 0); foreach ($test_results as $v) { $sum_results[$v]++; } @@ -1926,10 +1930,11 @@ if ($x_total) { $x_warned = (100.0 * $sum_results['WARNED']) / $x_total; $x_failed = (100.0 * $sum_results['FAILED']) / $x_total; + $x_xfailed = (100.0 * $sum_results['XFAILED']) / $x_total; $x_leaked = (100.0 * $sum_results['LEAKED']) / $x_total; $x_passed = (100.0 * $sum_results['PASSED']) / $x_total; } else { - $x_warned = $x_failed = $x_passed = $x_leaked = 0; + $x_warned = $x_failed = $x_passed = $x_leaked = $x_failed = 0; } $summary = ""; @@ -1953,7 +1958,9 @@ $summary .= " Tests skipped : " . sprintf("%4d (%5.1f%%)",$sum_results['SKIPPED'],$percent_results['SKIPPED']) . " -------- Tests warned : " . sprintf("%4d (%5.1f%%)",$sum_results['WARNED'], $percent_results['WARNED']) . " " . sprintf("(%5.1f%%)",$x_warned) . " -Tests failed : " . sprintf("%4d (%5.1f%%)",$sum_results['FAILED'], $percent_results['FAILED']) . " " . sprintf("(%5.1f%%)",$x_failed); +Tests failed : " . sprintf("%4d (%5.1f%%)",$sum_results['FAILED'], $percent_results['FAILED']) . " " . sprintf("(%5.1f%%)",$x_failed) . " +Expected fail : " . sprintf("%4d (%5.1f%%)",$sum_results['XFAILED'], $percent_results['XFAILED']) . " " . sprintf("(%5.1f%%)",$x_xfailed); + if ($leak_check) { $summary .= " Tests leaked : " . sprintf("%4d (%5.1f%%)",$sum_results['LEAKED'], $percent_results['LEAKED']) . " " . sprintf("(%5.1f%%)",$x_leaked); @@ -1988,6 +1995,18 @@ } $failed_test_summary .= "=====================================================================\n"; } + + if (count($PHP_FAILED_TESTS['XFAILED'])) { + $failed_test_summary .= " +===================================================================== +EXPECTED FAILED TEST SUMMARY +--------------------------------------------------------------------- +"; + foreach ($PHP_FAILED_TESTS['XFAILED'] as $test_data) { + $failed_test_summary .= ($test_data['unicode']?'U:':'N:') . $test_data['test_name'] . $test_data['info'] . "\n"; + } + $failed_test_summary .= "=====================================================================\n"; + } if (count($PHP_FAILED_TESTS['LEAKED'])) { $failed_test_summary .= "
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php