@@ -127,6 +127,9 @@ function show_usage(): void
127127 --color
128128 --no-color Do/Don't colorize the result type in the test result.
129129
130+ --progress
131+ --no-progress Do/Don't show the current progress.
132+
130133 --repeat [n]
131134 Run the tests multiple times in the same process and check the
132135 output of the last execution (CLI SAPI only).
@@ -159,7 +162,7 @@ function main(): void
159162 $ temp_source , $ temp_target , $ test_cnt , $ test_dirs ,
160163 $ test_files , $ test_idx , $ test_list , $ test_results , $ testfile ,
161164 $ user_tests , $ valgrind , $ sum_results , $ shuffle , $ file_cache , $ num_repeats ,
162- $ bless ;
165+ $ bless, $ show_progress ;
163166 // Parallel testing
164167 global $ workers , $ workerID ;
165168 global $ context_line_count ;
@@ -360,6 +363,7 @@ function main(): void
360363 $ workers = null ;
361364 $ context_line_count = 3 ;
362365 $ num_repeats = 1 ;
366+ $ show_progress = true ;
363367
364368 $ cfgtypes = ['show ' , 'keep ' ];
365369 $ cfgfiles = ['skip ' , 'php ' , 'clean ' , 'out ' , 'diff ' , 'exp ' , 'mem ' ];
@@ -600,6 +604,12 @@ function main(): void
600604 $ repeat = true ;
601605 }
602606 break ;
607+ case '--progress ' :
608+ $ show_progress = true ;
609+ break ;
610+ case '--no-progress ' :
611+ $ show_progress = false ;
612+ break ;
603613 case '--version ' :
604614 echo '$Id$ ' . "\n" ;
605615 exit (1 );
@@ -1331,7 +1341,7 @@ function run_all_tests(array $test_files, array $env, $redir_tested = null): voi
13311341 */
13321342function run_all_tests_parallel (array $ test_files , array $ env , $ redir_tested ): void
13331343{
1334- global $ workers , $ test_idx , $ test_cnt , $ test_results , $ failed_tests_file , $ result_tests_file , $ PHP_FAILED_TESTS , $ shuffle , $ SHOW_ONLY_GROUPS , $ valgrind ;
1344+ global $ workers , $ test_idx , $ test_cnt , $ test_results , $ failed_tests_file , $ result_tests_file , $ PHP_FAILED_TESTS , $ shuffle , $ SHOW_ONLY_GROUPS , $ valgrind, $ show_progress ;
13351345
13361346 global $ junit ;
13371347
@@ -1578,13 +1588,13 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
15781588 }
15791589 $ test_idx ++;
15801590
1581- if (! $ SHOW_ONLY_GROUPS ) {
1591+ if ($ show_progress ) {
15821592 clear_show_test ();
15831593 }
15841594
15851595 echo $ resultText ;
15861596
1587- if (! $ SHOW_ONLY_GROUPS ) {
1597+ if ($ show_progress ) {
15881598 show_test ($ test_idx , count ($ workerProcs ) . "/ $ workers concurrent test workers running " );
15891599 }
15901600
@@ -1634,7 +1644,7 @@ function run_all_tests_parallel(array $test_files, array $env, $redir_tested): v
16341644 }
16351645 }
16361646
1637- if (! $ SHOW_ONLY_GROUPS ) {
1647+ if ($ show_progress ) {
16381648 clear_show_test ();
16391649 }
16401650
@@ -3223,22 +3233,22 @@ function show_summary(): void
32233233
32243234function show_redirect_start (string $ tests , string $ tested , string $ tested_file ): void
32253235{
3226- global $ SHOW_ONLY_GROUPS ;
3236+ global $ SHOW_ONLY_GROUPS , $ show_progress ;
32273237
32283238 if (!$ SHOW_ONLY_GROUPS || in_array ('REDIRECT ' , $ SHOW_ONLY_GROUPS )) {
32293239 echo "REDIRECT $ tests ( $ tested [ $ tested_file]) begin \n" ;
3230- } else {
3240+ } elseif ( $ show_progress ) {
32313241 clear_show_test ();
32323242 }
32333243}
32343244
32353245function show_redirect_ends (string $ tests , string $ tested , string $ tested_file ): void
32363246{
3237- global $ SHOW_ONLY_GROUPS ;
3247+ global $ SHOW_ONLY_GROUPS , $ show_progress ;
32383248
32393249 if (!$ SHOW_ONLY_GROUPS || in_array ('REDIRECT ' , $ SHOW_ONLY_GROUPS )) {
32403250 echo "REDIRECT $ tests ( $ tested [ $ tested_file]) done \n" ;
3241- } else {
3251+ } elseif ( $ show_progress ) {
32423252 clear_show_test ();
32433253 }
32443254}
@@ -3280,7 +3290,7 @@ function show_result(
32803290 string $ extra = '' ,
32813291 ?array $ temp_filenames = null
32823292): void {
3283- global $ SHOW_ONLY_GROUPS , $ colorize ;
3293+ global $ SHOW_ONLY_GROUPS , $ colorize, $ show_progress ;
32843294
32853295 if (!$ SHOW_ONLY_GROUPS || in_array ($ result , $ SHOW_ONLY_GROUPS )) {
32863296 if ($ colorize ) {
@@ -3302,10 +3312,9 @@ function show_result(
33023312 } else {
33033313 echo "$ result $ tested [ $ tested_file] $ extra \n" ;
33043314 }
3305- } elseif (! $ SHOW_ONLY_GROUPS ) {
3315+ } elseif ($ show_progress ) {
33063316 clear_show_test ();
33073317 }
3308-
33093318}
33103319
33113320class BorkageException extends Exception
0 commit comments