diff options
author | Zoe Slattery <zoe@php.net> | 2008-05-25 16:05:04 +0000 |
---|---|---|
committer | Zoe Slattery <zoe@php.net> | 2008-05-25 16:05:04 +0000 |
commit | 0cf47e6f1183c74eedee3f947a963cfda00b0bf0 (patch) | |
tree | fe7d8380d4545c0697e226d010138ce96b476746 /run-tests.php | |
parent | 5b398bf78de82857c25e74a59613b30a94d4d951 (diff) | |
download | php-git-0cf47e6f1183c74eedee3f947a963cfda00b0bf0.tar.gz |
Added --XFAIL-- section
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/run-tests.php b/run-tests.php index 63893eee2c..da9f83b9ef 100755 --- a/run-tests.php +++ b/run-tests.php @@ -260,7 +260,7 @@ VALGRIND : " . ($leak_check ? $valgrind_header : 'Not used') . " $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; @@ -712,7 +712,7 @@ define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php'); /* 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"; @@ -748,8 +748,8 @@ if ($just_save_results || !getenv('NO_INTERACTION')) { $failed_tests_data .= $failed_test_summary . "\n"; $failed_tests_data .= get_summary(true, false) . "\n"; - - if ($sum_results['FAILED']) { + //Not sending XFAIL results since failure is intentional. + if ($sum_results['FAILED'] ) { foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) { $failed_tests_data .= $sep . $test_info['name'] . $test_info['info']; $failed_tests_data .= $sep . file_get_contents(realpath($test_info['output'])); @@ -981,7 +981,7 @@ function run_all_tests($test_files, $env, $redir_tested = NULL) if (!is_array($name) && $result != 'REDIR') { $test_results[$index] = $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"); } @@ -1627,7 +1627,11 @@ COMMAND $cmd $restype[] = 'WARN'; } if (!$passed) { - $restype[] = 'FAIL'; + if(isset($section_text['XFAIL'])) { + $restype[] = 'XFAIL'; + }else{ + $restype[] = 'FAIL'; + } } if (!$passed) { @@ -1840,7 +1844,7 @@ function compute_summary() $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]++; } @@ -1859,10 +1863,11 @@ function get_summary($show_ext_summary, $show_html) 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_xfailed = 0; } $summary = ""; @@ -1886,7 +1891,8 @@ Tests borked : " . sprintf("%4d (%5.1f%%)",$sum_results['BORKED'],$percent_re $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); @@ -1921,6 +1927,17 @@ FAILED TEST SUMMARY } $failed_test_summary .= "=====================================================================\n"; } + if (count($PHP_FAILED_TESTS['XFAILED'])) { + $failed_test_summary .= " +===================================================================== +EXPECTED FAILED TEST SUMMARY +--------------------------------------------------------------------- +"; + foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) { + $failed_test_summary .= $failed_test_data['test_name'] . $failed_test_data['info'] . "\n"; + } + $failed_test_summary .= "=====================================================================\n"; + } if (count($PHP_FAILED_TESTS['LEAKED'])) { $failed_test_summary .= " |