Skip to content

Commit bce0501

Browse files
committed
Removing HTML Functionality from run-tests.php
1 parent cb0fa99 commit bce0501

File tree

1 file changed

+7
-114
lines changed

1 file changed

+7
-114
lines changed

run-tests.php

Lines changed: 7 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,9 @@ function show_usage()
8787
--help
8888
-h This Help.
8989
90-
--html <file> Generate HTML output.
91-
9290
--temp-source <sdir> --temp-target <tdir> [--temp-urlbase <url>]
9391
Write temporary files to <tdir> by replacing <sdir> from the
94-
filenames to generate with <tdir>. If --html is being used and
95-
<url> given then the generated links are relative and prefixed
96-
with the given url. In general you want to make <sdir> the path
92+
filenames to generate with <tdir>. In general you want to make <sdir> the path
9793
to your source files and <tdir> some patch in your web page
9894
hierarchy with <url> pointing to <tdir>.
9995
@@ -137,7 +133,7 @@ function main()
137133
global $DETAILED, $PHP_FAILED_TESTS, $SHOW_ONLY_GROUPS, $argc, $argv, $cfg,
138134
$cfgfiles, $cfgtypes, $conf_passed, $end_time, $environment,
139135
$exts_skipped, $exts_tested, $exts_to_test, $failed_tests_file,
140-
$html_file, $html_output, $ignored_by_ext, $ini_overwrites, $is_switch,
136+
$ignored_by_ext, $ini_overwrites, $is_switch,
141137
$just_save_results, $log_format, $matches, $no_clean, $no_file_cache,
142138
$optionals, $output_file, $pass_option_n, $pass_options,
143139
$pattern_match, $php, $php_cgi, $phpdbg, $preload, $redir_tests,
@@ -378,8 +374,6 @@ function main()
378374

379375
$just_save_results = false;
380376
$valgrind = null;
381-
$html_output = false;
382-
$html_file = null;
383377
$temp_source = null;
384378
$temp_target = null;
385379
$temp_urlbase = null;
@@ -606,10 +600,6 @@ function main()
606600
$repeat = true;
607601
}
608602
break;
609-
case '--html':
610-
$html_file = fopen($argv[++$i], 'wt');
611-
$html_output = is_resource($html_file);
612-
break;
613603
case '--version':
614604
echo '$Id$' . "\n";
615605
exit(1);
@@ -691,20 +681,12 @@ function main()
691681
usort($test_files, "test_sort");
692682
$start_time = time();
693683

694-
if (!$html_output) {
695-
echo "Running selected tests.\n";
696-
} else {
697-
show_start($start_time);
698-
}
684+
echo "Running selected tests.\n";
699685

700686
$test_idx = 0;
701687
run_all_tests($test_files, $environment);
702688
$end_time = time();
703689

704-
if ($html_output) {
705-
show_end($end_time);
706-
}
707-
708690
if ($failed_tests_file) {
709691
fclose($failed_tests_file);
710692
}
@@ -719,16 +701,9 @@ function main()
719701
}
720702

721703
compute_summary();
722-
if ($html_output) {
723-
fwrite($html_file, "<hr/>\n" . get_summary(false, true));
724-
}
725704
echo "=====================================================================";
726705
echo get_summary(false, false);
727706

728-
if ($html_output) {
729-
fclose($html_file);
730-
}
731-
732707
if ($output_file != '' && $just_save_results) {
733708
save_or_mail_results();
734709
}
@@ -792,10 +767,6 @@ function main()
792767
show_end($end_time);
793768
show_summary();
794769

795-
if ($html_output) {
796-
fclose($html_file);
797-
}
798-
799770
save_or_mail_results();
800771
}
801772

@@ -3014,7 +2985,7 @@ function compute_summary()
30142985
}
30152986
}
30162987

3017-
function get_summary($show_ext_summary, $show_html)
2988+
function get_summary($show_ext_summary)
30182989
{
30192990
global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind;
30202991

@@ -3033,10 +3004,6 @@ function get_summary($show_ext_summary, $show_html)
30333004

30343005
$summary = '';
30353006

3036-
if ($show_html) {
3037-
$summary .= "<pre>\n";
3038-
}
3039-
30403007
if ($show_ext_summary) {
30413008
$summary .= '
30423009
=====================================================================
@@ -3178,55 +3145,27 @@ function get_summary($show_ext_summary, $show_html)
31783145
$summary .= $failed_test_summary;
31793146
}
31803147

3181-
if ($show_html) {
3182-
$summary .= "</pre>";
3183-
}
3184-
31853148
return $summary;
31863149
}
31873150

31883151
function show_start($start_time)
31893152
{
3190-
global $html_output, $html_file;
3191-
3192-
if ($html_output) {
3193-
fwrite($html_file, "<h2>Time Start: " . date('Y-m-d H:i:s', $start_time) . "</h2>\n");
3194-
fwrite($html_file, "<table>\n");
3195-
}
3196-
31973153
echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n";
31983154
}
31993155

32003156
function show_end($end_time)
32013157
{
3202-
global $html_output, $html_file;
3203-
3204-
if ($html_output) {
3205-
fwrite($html_file, "</table>\n");
3206-
fwrite($html_file, "<h2>Time End: " . date('Y-m-d H:i:s', $end_time) . "</h2>\n");
3207-
}
3208-
32093158
echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n";
32103159
}
32113160

32123161
function show_summary()
32133162
{
3214-
global $html_output, $html_file;
3215-
3216-
if ($html_output) {
3217-
fwrite($html_file, "<hr/>\n" . get_summary(true, true));
3218-
}
3219-
32203163
echo get_summary(true, false);
32213164
}
32223165

32233166
function show_redirect_start($tests, $tested, $tested_file)
32243167
{
3225-
global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
3226-
3227-
if ($html_output) {
3228-
fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) begin</td></tr>\n");
3229-
}
3168+
global $SHOW_ONLY_GROUPS;
32303169

32313170
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
32323171
echo "REDIRECT $tests ($tested [$tested_file]) begin\n";
@@ -3237,11 +3176,7 @@ function show_redirect_start($tests, $tested, $tested_file)
32373176

32383177
function show_redirect_ends($tests, $tested, $tested_file)
32393178
{
3240-
global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
3241-
3242-
if ($html_output) {
3243-
fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) done</td></tr>\n");
3244-
}
3179+
global $SHOW_ONLY_GROUPS;
32453180

32463181
if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
32473182
echo "REDIRECT $tests ($tested [$tested_file]) done\n";
@@ -3282,56 +3217,14 @@ function parse_conflicts(string $text): array
32823217

32833218
function show_result($result, $tested, $tested_file, $extra = '', $temp_filenames = null)
32843219
{
3285-
global $html_output, $html_file, $temp_target, $temp_urlbase, $line_length, $SHOW_ONLY_GROUPS;
3220+
global $temp_target, $temp_urlbase, $line_length, $SHOW_ONLY_GROUPS;
32863221

32873222
if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
32883223
echo "$result $tested [$tested_file] $extra\n";
32893224
} elseif (!$SHOW_ONLY_GROUPS) {
32903225
clear_show_test();
32913226
}
32923227

3293-
if ($html_output) {
3294-
if (isset($temp_filenames['file']) && file_exists($temp_filenames['file'])) {
3295-
$url = str_replace($temp_target, $temp_urlbase, $temp_filenames['file']);
3296-
$tested = "<a href='$url'>$tested</a>";
3297-
}
3298-
3299-
if (isset($temp_filenames['skip']) && file_exists($temp_filenames['skip'])) {
3300-
if (empty($extra)) {
3301-
$extra = "skipif";
3302-
}
3303-
3304-
$url = str_replace($temp_target, $temp_urlbase, $temp_filenames['skip']);
3305-
$extra = "<a href='$url'>$extra</a>";
3306-
} elseif (empty($extra)) {
3307-
$extra = "&nbsp;";
3308-
}
3309-
3310-
if (isset($temp_filenames['diff']) && file_exists($temp_filenames['diff'])) {
3311-
$url = str_replace($temp_target, $temp_urlbase, $temp_filenames['diff']);
3312-
$diff = "<a href='$url'>diff</a>";
3313-
} else {
3314-
$diff = "&nbsp;";
3315-
}
3316-
3317-
if (isset($temp_filenames['mem']) && file_exists($temp_filenames['mem'])) {
3318-
$url = str_replace($temp_target, $temp_urlbase, $temp_filenames['mem']);
3319-
$mem = "<a href='$url'>leaks</a>";
3320-
} else {
3321-
$mem = "&nbsp;";
3322-
}
3323-
3324-
fwrite(
3325-
$html_file,
3326-
"<tr>" .
3327-
"<td>$result</td>" .
3328-
"<td>$tested</td>" .
3329-
"<td>$extra</td>" .
3330-
"<td>$diff</td>" .
3331-
"<td>$mem</td>" .
3332-
"</tr>\n"
3333-
);
3334-
}
33353228
}
33363229

33373230
function junit_init()

0 commit comments

Comments
 (0)