@@ -87,15 +87,11 @@ function show_usage()
87
87
--help
88
88
-h This Help.
89
89
90
- --html <file> Generate HTML output.
91
-
92
90
--temp-source <sdir> --temp-target <tdir> [--temp-urlbase <url>]
93
91
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
97
- to your source files and <tdir> some patch in your web page
98
- hierarchy with <url> pointing to <tdir>.
92
+ filenames to generate with <tdir>. In general you want to make
93
+ <sdir> the path to your source files and <tdir> some patch in
94
+ your web page hierarchy with <url> pointing to <tdir>.
99
95
100
96
--keep-[all|php|skip|clean]
101
97
Do not delete 'all' files, 'php' test file, 'skip' or 'clean'
@@ -137,7 +133,7 @@ function main()
137
133
global $ DETAILED , $ PHP_FAILED_TESTS , $ SHOW_ONLY_GROUPS , $ argc , $ argv , $ cfg ,
138
134
$ cfgfiles , $ cfgtypes , $ conf_passed , $ end_time , $ environment ,
139
135
$ 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 ,
141
137
$ just_save_results , $ log_format , $ matches , $ no_clean , $ no_file_cache ,
142
138
$ optionals , $ output_file , $ pass_option_n , $ pass_options ,
143
139
$ pattern_match , $ php , $ php_cgi , $ phpdbg , $ preload , $ redir_tests ,
@@ -378,8 +374,6 @@ function main()
378
374
379
375
$ just_save_results = false ;
380
376
$ valgrind = null ;
381
- $ html_output = false ;
382
- $ html_file = null ;
383
377
$ temp_source = null ;
384
378
$ temp_target = null ;
385
379
$ temp_urlbase = null ;
@@ -606,10 +600,6 @@ function main()
606
600
$ repeat = true ;
607
601
}
608
602
break ;
609
- case '--html ' :
610
- $ html_file = fopen ($ argv [++$ i ], 'wt ' );
611
- $ html_output = is_resource ($ html_file );
612
- break ;
613
603
case '--version ' :
614
604
echo '$Id$ ' . "\n" ;
615
605
exit (1 );
@@ -691,20 +681,12 @@ function main()
691
681
usort ($ test_files , "test_sort " );
692
682
$ start_time = time ();
693
683
694
- if (!$ html_output ) {
695
- echo "Running selected tests. \n" ;
696
- } else {
697
- show_start ($ start_time );
698
- }
684
+ echo "Running selected tests. \n" ;
699
685
700
686
$ test_idx = 0 ;
701
687
run_all_tests ($ test_files , $ environment );
702
688
$ end_time = time ();
703
689
704
- if ($ html_output ) {
705
- show_end ($ end_time );
706
- }
707
-
708
690
if ($ failed_tests_file ) {
709
691
fclose ($ failed_tests_file );
710
692
}
@@ -719,15 +701,8 @@ function main()
719
701
}
720
702
721
703
compute_summary ();
722
- if ($ html_output ) {
723
- fwrite ($ html_file , "<hr/> \n" . get_summary (false , true ));
724
- }
725
704
echo "===================================================================== " ;
726
- echo get_summary (false , false );
727
-
728
- if ($ html_output ) {
729
- fclose ($ html_file );
730
- }
705
+ echo get_summary (false );
731
706
732
707
if ($ output_file != '' && $ just_save_results ) {
733
708
save_or_mail_results ();
@@ -792,10 +767,6 @@ function main()
792
767
show_end ($ end_time );
793
768
show_summary ();
794
769
795
- if ($ html_output ) {
796
- fclose ($ html_file );
797
- }
798
-
799
770
save_or_mail_results ();
800
771
}
801
772
@@ -962,7 +933,7 @@ function save_or_mail_results()
962
933
$ failed_tests_data = '' ;
963
934
$ sep = "\n" . str_repeat ('= ' , 80 ) . "\n" ;
964
935
$ failed_tests_data .= $ failed_test_summary . "\n" ;
965
- $ failed_tests_data .= get_summary (true , false ) . "\n" ;
936
+ $ failed_tests_data .= get_summary (true ) . "\n" ;
966
937
967
938
if ($ sum_results ['FAILED ' ]) {
968
939
foreach ($ PHP_FAILED_TESTS ['FAILED ' ] as $ test_info ) {
@@ -3015,7 +2986,7 @@ function compute_summary()
3015
2986
}
3016
2987
}
3017
2988
3018
- function get_summary ($ show_ext_summary, $ show_html )
2989
+ function get_summary ($ show_ext_summary )
3019
2990
{
3020
2991
global $ exts_skipped , $ exts_tested , $ n_total , $ sum_results , $ percent_results , $ end_time , $ start_time , $ failed_test_summary , $ PHP_FAILED_TESTS , $ valgrind ;
3021
2992
@@ -3034,10 +3005,6 @@ function get_summary($show_ext_summary, $show_html)
3034
3005
3035
3006
$ summary = '' ;
3036
3007
3037
- if ($ show_html ) {
3038
- $ summary .= "<pre> \n" ;
3039
- }
3040
-
3041
3008
if ($ show_ext_summary ) {
3042
3009
$ summary .= '
3043
3010
=====================================================================
@@ -3179,55 +3146,27 @@ function get_summary($show_ext_summary, $show_html)
3179
3146
$ summary .= $ failed_test_summary ;
3180
3147
}
3181
3148
3182
- if ($ show_html ) {
3183
- $ summary .= "</pre> " ;
3184
- }
3185
-
3186
3149
return $ summary ;
3187
3150
}
3188
3151
3189
3152
function show_start ($ start_time )
3190
3153
{
3191
- global $ html_output , $ html_file ;
3192
-
3193
- if ($ html_output ) {
3194
- fwrite ($ html_file , "<h2>Time Start: " . date ('Y-m-d H:i:s ' , $ start_time ) . "</h2> \n" );
3195
- fwrite ($ html_file , "<table> \n" );
3196
- }
3197
-
3198
3154
echo "TIME START " . date ('Y-m-d H:i:s ' , $ start_time ) . "\n===================================================================== \n" ;
3199
3155
}
3200
3156
3201
3157
function show_end ($ end_time )
3202
3158
{
3203
- global $ html_output , $ html_file ;
3204
-
3205
- if ($ html_output ) {
3206
- fwrite ($ html_file , "</table> \n" );
3207
- fwrite ($ html_file , "<h2>Time End: " . date ('Y-m-d H:i:s ' , $ end_time ) . "</h2> \n" );
3208
- }
3209
-
3210
3159
echo "===================================================================== \nTIME END " . date ('Y-m-d H:i:s ' , $ end_time ) . "\n" ;
3211
3160
}
3212
3161
3213
3162
function show_summary ()
3214
3163
{
3215
- global $ html_output , $ html_file ;
3216
-
3217
- if ($ html_output ) {
3218
- fwrite ($ html_file , "<hr/> \n" . get_summary (true , true ));
3219
- }
3220
-
3221
- echo get_summary (true , false );
3164
+ echo get_summary (true );
3222
3165
}
3223
3166
3224
3167
function show_redirect_start ($ tests , $ tested , $ tested_file )
3225
3168
{
3226
- global $ html_output , $ html_file , $ line_length , $ SHOW_ONLY_GROUPS ;
3227
-
3228
- if ($ html_output ) {
3229
- fwrite ($ html_file , "<tr><td colspan='3'>---> $ tests ( $ tested [ $ tested_file]) begin</td></tr> \n" );
3230
- }
3169
+ global $ SHOW_ONLY_GROUPS ;
3231
3170
3232
3171
if (!$ SHOW_ONLY_GROUPS || in_array ('REDIRECT ' , $ SHOW_ONLY_GROUPS )) {
3233
3172
echo "REDIRECT $ tests ( $ tested [ $ tested_file]) begin \n" ;
@@ -3238,11 +3177,7 @@ function show_redirect_start($tests, $tested, $tested_file)
3238
3177
3239
3178
function show_redirect_ends ($ tests , $ tested , $ tested_file )
3240
3179
{
3241
- global $ html_output , $ html_file , $ line_length , $ SHOW_ONLY_GROUPS ;
3242
-
3243
- if ($ html_output ) {
3244
- fwrite ($ html_file , "<tr><td colspan='3'>---> $ tests ( $ tested [ $ tested_file]) done</td></tr> \n" );
3245
- }
3180
+ global $ SHOW_ONLY_GROUPS ;
3246
3181
3247
3182
if (!$ SHOW_ONLY_GROUPS || in_array ('REDIRECT ' , $ SHOW_ONLY_GROUPS )) {
3248
3183
echo "REDIRECT $ tests ( $ tested [ $ tested_file]) done \n" ;
@@ -3283,56 +3218,14 @@ function parse_conflicts(string $text): array
3283
3218
3284
3219
function show_result ($ result , $ tested , $ tested_file , $ extra = '' , $ temp_filenames = null )
3285
3220
{
3286
- global $ html_output , $ html_file , $ temp_target , $ temp_urlbase , $ line_length , $ SHOW_ONLY_GROUPS ;
3221
+ global $ temp_target , $ temp_urlbase , $ line_length , $ SHOW_ONLY_GROUPS ;
3287
3222
3288
3223
if (!$ SHOW_ONLY_GROUPS || in_array ($ result , $ SHOW_ONLY_GROUPS )) {
3289
3224
echo "$ result $ tested [ $ tested_file] $ extra \n" ;
3290
3225
} elseif (!$ SHOW_ONLY_GROUPS ) {
3291
3226
clear_show_test ();
3292
3227
}
3293
3228
3294
- if ($ html_output ) {
3295
- if (isset ($ temp_filenames ['file ' ]) && file_exists ($ temp_filenames ['file ' ])) {
3296
- $ url = str_replace ($ temp_target , $ temp_urlbase , $ temp_filenames ['file ' ]);
3297
- $ tested = "<a href=' $ url'> $ tested</a> " ;
3298
- }
3299
-
3300
- if (isset ($ temp_filenames ['skip ' ]) && file_exists ($ temp_filenames ['skip ' ])) {
3301
- if (empty ($ extra )) {
3302
- $ extra = "skipif " ;
3303
- }
3304
-
3305
- $ url = str_replace ($ temp_target , $ temp_urlbase , $ temp_filenames ['skip ' ]);
3306
- $ extra = "<a href=' $ url'> $ extra</a> " ;
3307
- } elseif (empty ($ extra )) {
3308
- $ extra = " " ;
3309
- }
3310
-
3311
- if (isset ($ temp_filenames ['diff ' ]) && file_exists ($ temp_filenames ['diff ' ])) {
3312
- $ url = str_replace ($ temp_target , $ temp_urlbase , $ temp_filenames ['diff ' ]);
3313
- $ diff = "<a href=' $ url'>diff</a> " ;
3314
- } else {
3315
- $ diff = " " ;
3316
- }
3317
-
3318
- if (isset ($ temp_filenames ['mem ' ]) && file_exists ($ temp_filenames ['mem ' ])) {
3319
- $ url = str_replace ($ temp_target , $ temp_urlbase , $ temp_filenames ['mem ' ]);
3320
- $ mem = "<a href=' $ url'>leaks</a> " ;
3321
- } else {
3322
- $ mem = " " ;
3323
- }
3324
-
3325
- fwrite (
3326
- $ html_file ,
3327
- "<tr> " .
3328
- "<td> $ result</td> " .
3329
- "<td> $ tested</td> " .
3330
- "<td> $ extra</td> " .
3331
- "<td> $ diff</td> " .
3332
- "<td> $ mem</td> " .
3333
- "</tr> \n"
3334
- );
3335
- }
3336
3229
}
3337
3230
3338
3231
function junit_init ()
0 commit comments