diff --git a/run-tests.php b/run-tests.php index 0a2f592c8ca85..2ffc5a57eeb0b 100755 --- a/run-tests.php +++ b/run-tests.php @@ -87,15 +87,11 @@ function show_usage() --help -h This Help. - --html Generate HTML output. - --temp-source --temp-target [--temp-urlbase ] Write temporary files to by replacing from the - filenames to generate with . If --html is being used and - given then the generated links are relative and prefixed - with the given url. In general you want to make the path - to your source files and some patch in your web page - hierarchy with pointing to . + filenames to generate with . In general you want to make + the path to your source files and some patch in + your web page hierarchy with pointing to . --keep-[all|php|skip|clean] Do not delete 'all' files, 'php' test file, 'skip' or 'clean' @@ -137,7 +133,7 @@ function main() global $DETAILED, $PHP_FAILED_TESTS, $SHOW_ONLY_GROUPS, $argc, $argv, $cfg, $cfgfiles, $cfgtypes, $conf_passed, $end_time, $environment, $exts_skipped, $exts_tested, $exts_to_test, $failed_tests_file, - $html_file, $html_output, $ignored_by_ext, $ini_overwrites, $is_switch, + $ignored_by_ext, $ini_overwrites, $is_switch, $just_save_results, $log_format, $matches, $no_clean, $no_file_cache, $optionals, $output_file, $pass_option_n, $pass_options, $pattern_match, $php, $php_cgi, $phpdbg, $preload, $redir_tests, @@ -378,8 +374,6 @@ function main() $just_save_results = false; $valgrind = null; - $html_output = false; - $html_file = null; $temp_source = null; $temp_target = null; $temp_urlbase = null; @@ -606,10 +600,6 @@ function main() $repeat = true; } break; - case '--html': - $html_file = fopen($argv[++$i], 'wt'); - $html_output = is_resource($html_file); - break; case '--version': echo '$Id$' . "\n"; exit(1); @@ -691,20 +681,12 @@ function main() usort($test_files, "test_sort"); $start_time = time(); - if (!$html_output) { - echo "Running selected tests.\n"; - } else { - show_start($start_time); - } + echo "Running selected tests.\n"; $test_idx = 0; run_all_tests($test_files, $environment); $end_time = time(); - if ($html_output) { - show_end($end_time); - } - if ($failed_tests_file) { fclose($failed_tests_file); } @@ -719,15 +701,8 @@ function main() } compute_summary(); - if ($html_output) { - fwrite($html_file, "
\n" . get_summary(false, true)); - } echo "====================================================================="; - echo get_summary(false, false); - - if ($html_output) { - fclose($html_file); - } + echo get_summary(false); if ($output_file != '' && $just_save_results) { save_or_mail_results(); @@ -792,10 +767,6 @@ function main() show_end($end_time); show_summary(); - if ($html_output) { - fclose($html_file); - } - save_or_mail_results(); } @@ -962,7 +933,7 @@ function save_or_mail_results() $failed_tests_data = ''; $sep = "\n" . str_repeat('=', 80) . "\n"; $failed_tests_data .= $failed_test_summary . "\n"; - $failed_tests_data .= get_summary(true, false) . "\n"; + $failed_tests_data .= get_summary(true) . "\n"; if ($sum_results['FAILED']) { foreach ($PHP_FAILED_TESTS['FAILED'] as $test_info) { @@ -3014,7 +2985,7 @@ function compute_summary() } } -function get_summary($show_ext_summary, $show_html) +function get_summary($show_ext_summary) { global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind; @@ -3033,10 +3004,6 @@ function get_summary($show_ext_summary, $show_html) $summary = ''; - if ($show_html) { - $summary .= "
\n";
-    }
-
     if ($show_ext_summary) {
         $summary .= '
 =====================================================================
@@ -3178,55 +3145,27 @@ function get_summary($show_ext_summary, $show_html)
         $summary .= $failed_test_summary;
     }
 
-    if ($show_html) {
-        $summary .= "
"; - } - return $summary; } function show_start($start_time) { - global $html_output, $html_file; - - if ($html_output) { - fwrite($html_file, "

Time Start: " . date('Y-m-d H:i:s', $start_time) . "

\n"); - fwrite($html_file, "\n"); - } - echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n"; } function show_end($end_time) { - global $html_output, $html_file; - - if ($html_output) { - fwrite($html_file, "
\n"); - fwrite($html_file, "

Time End: " . date('Y-m-d H:i:s', $end_time) . "

\n"); - } - echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n"; } function show_summary() { - global $html_output, $html_file; - - if ($html_output) { - fwrite($html_file, "
\n" . get_summary(true, true)); - } - - echo get_summary(true, false); + echo get_summary(true); } function show_redirect_start($tests, $tested, $tested_file) { - global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS; - - if ($html_output) { - fwrite($html_file, "---> $tests ($tested [$tested_file]) begin\n"); - } + global $SHOW_ONLY_GROUPS; if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) { echo "REDIRECT $tests ($tested [$tested_file]) begin\n"; @@ -3237,11 +3176,7 @@ function show_redirect_start($tests, $tested, $tested_file) function show_redirect_ends($tests, $tested, $tested_file) { - global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS; - - if ($html_output) { - fwrite($html_file, "---> $tests ($tested [$tested_file]) done\n"); - } + global $SHOW_ONLY_GROUPS; if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) { echo "REDIRECT $tests ($tested [$tested_file]) done\n"; @@ -3282,7 +3217,7 @@ function parse_conflicts(string $text): array function show_result($result, $tested, $tested_file, $extra = '', $temp_filenames = null) { - global $html_output, $html_file, $temp_target, $temp_urlbase, $line_length, $SHOW_ONLY_GROUPS; + global $temp_target, $temp_urlbase, $line_length, $SHOW_ONLY_GROUPS; if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) { echo "$result $tested [$tested_file] $extra\n"; @@ -3290,48 +3225,6 @@ function show_result($result, $tested, $tested_file, $extra = '', $temp_filename clear_show_test(); } - if ($html_output) { - if (isset($temp_filenames['file']) && file_exists($temp_filenames['file'])) { - $url = str_replace($temp_target, $temp_urlbase, $temp_filenames['file']); - $tested = "$tested"; - } - - if (isset($temp_filenames['skip']) && file_exists($temp_filenames['skip'])) { - if (empty($extra)) { - $extra = "skipif"; - } - - $url = str_replace($temp_target, $temp_urlbase, $temp_filenames['skip']); - $extra = "$extra"; - } elseif (empty($extra)) { - $extra = " "; - } - - if (isset($temp_filenames['diff']) && file_exists($temp_filenames['diff'])) { - $url = str_replace($temp_target, $temp_urlbase, $temp_filenames['diff']); - $diff = "diff"; - } else { - $diff = " "; - } - - if (isset($temp_filenames['mem']) && file_exists($temp_filenames['mem'])) { - $url = str_replace($temp_target, $temp_urlbase, $temp_filenames['mem']); - $mem = "leaks"; - } else { - $mem = " "; - } - - fwrite( - $html_file, - "" . - "$result" . - "$tested" . - "$extra" . - "$diff" . - "$mem" . - "\n" - ); - } } function junit_init()