$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;
/* 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";
$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']));
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");
}
$restype[] = 'WARN';
}
if (!$passed) {
- $restype[] = 'FAIL';
+ if(isset($section_text['XFAIL'])) {
+ $restype[] = 'XFAIL';
+ }else{
+ $restype[] = 'FAIL';
+ }
}
if (!$passed) {
$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]++;
}
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 = "";
$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);
}
$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 .= "