php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55788
Patch run-tests.php.diff revision 2011-09-28 23:20 UTC by tyrael@php.net
revision 2011-09-26 21:55 UTC by tyrael

Patch run-tests.php.diff for Testing related Bug #55788

Patch version 2011-09-28 23:20 UTC

Return to Bug #55788 | Download this patch
Patch Revisions: 2011-09-28 23:20 UTC | 2011-09-26 21:55 UTC

Developer: tyrael@php.net



  Index: run-tests.php
  ===================================================================
 --- run-tests.php       (revision 317341)
 +++ run-tests.php       (working copy)
 --- run-tests.php	(revision 317452)
 +++ run-tests.php	(working copy)
 @@ -685,7 +685,7 @@
                  with value 'bar').
  
      -g          Comma seperated list of groups to show during test run
 -                (e.x. FAIL,SKIP).
 +                (possible values: PASS, FAIL, XFAIL, SKIP, BORK, WARN, LEAK, REDIRECT).
  
      -m          Test for memory leaks with Valgrind.
  
  @@ -2415,24 +2415,34 @@
 
  
   function show_redirect_start($tests, $tested, $tested_file)
   {
 -       global $html_output, $html_file;
 +       global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
 
         if ($html_output) {
                 fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) begin</td></tr>\n");
         }
 
 -       echo "---> $tests ($tested [$tested_file]) begin\n";
 +       if (!$SHOW_ONLY_GROUPS || in_array('--->', $SHOW_ONLY_GROUPS)) {
 +               echo "---> $tests ($tested [$tested_file]) begin\n";
 +       } else {
 +               // Write over the last line to avoid random trailing chars on next echo
 +               echo str_repeat(" ", $line_length), "\r";
 +       }
 -	global $html_output, $html_file;
 +	global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
  
  	if ($html_output) {
  		fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) begin</td></tr>\n");
  	}
  
 -	echo "---> $tests ($tested [$tested_file]) begin\n";
 +	if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
 +		   echo "REDIRECT $tests ($tested [$tested_file]) begin\n";
 +	} else {
 +		   // Write over the last line to avoid random trailing chars on next echo
 +		   echo str_repeat(" ", $line_length), "\r";
 +	}
   }
 
  
   function show_redirect_ends($tests, $tested, $tested_file)
   {
 -       global $html_output, $html_file;
 +       global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
 
         if ($html_output) {
                 fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) done</td></tr>\n");
         }
 
 -       echo "---> $tests ($tested [$tested_file]) done\n";
 +       if (!$SHOW_ONLY_GROUPS || in_array('--->', $SHOW_ONLY_GROUPS)) {
 +               echo "---> $tests ($tested [$tested_file]) done\n";
 +       } else {
 +               // Write over the last line to avoid random trailing chars on next echo
 +               echo str_repeat(" ", $line_length), "\r";
 +       }
 -	global $html_output, $html_file;
 +	global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;
  
  	if ($html_output) {
  		fwrite($html_file, "<tr><td colspan='3'>---&gt; $tests ($tested [$tested_file]) done</td></tr>\n");
  	}
  
 -	echo "---> $tests ($tested [$tested_file]) done\n";
 +	if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
 +		   echo "REDIRECT $tests ($tested [$tested_file]) done\n";
 +	} else {
 +		   // Write over the last line to avoid random trailing chars on next echo
 +		   echo str_repeat(" ", $line_length), "\r";
 +	}
   }
 
  
   function show_test($test_idx, $shortname)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC