Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-20 Thread Michael Wallner
On 19 March 2012 20:15, Christopher Jones christopher.jo...@oracle.com wrote:
 Hi Mike,

 Can you update (or get updated) http://qa.php.net/phpt_details.php
 with this feature?

Here we go:
https://github.com/php/web-qa/pull/3



 It's way too buried for my liking, but the path is:

 http://qa.php.net/
 http://qa.php.net/howtohelp.php
 http://qa.php.net/write-test.php

 Then down in the PHPT structure details section is a link title here to
 http://qa.php.net/phpt_details.php

Jeez!

-- 
Regards,
Mike

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Christopher Jones



On 03/17/2012 02:35 AM, Michael Wallner wrote:

mike Sat, 17 Mar 2012 09:35:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324319

Log:
add --PUT-- section support based on POST_RAW

Changed paths:
 U   php/php-src/branches/PHP_5_3/run-tests.php
 U   php/php-src/branches/PHP_5_4/run-tests.php
 U   php/php-src/trunk/run-tests.php


Hi Mike,

Can you update (or get updated) http://qa.php.net/phpt_details.php
with this feature?

Thanks,

Chris



Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) {
+
+   if (empty($env['CONTENT_TYPE'])  
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
+   $env['CONTENT_TYPE'] = trim(str_replace(\r, 
'', $res[1]));
+   continue;
+   }
+
+   if ($started) {
+   $request .= \n;
+   }
+
+   $started = true;
+   $request .= $line;
+   }
+
+   $env['CONTENT_LENGTH'] = strlen($request);
+   $env['REQUEST_METHOD'] = 'PUT';
+
+   if (empty($request)) {
+   if ($JUNIT) {
+   $JUNIT['test_total']++;
+   $JUNIT['test_error']++;
+   $JUNIT['result_xml'] .= 'testcase classname='.$shortname.' 
name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+   $JUNIT['result_xml'] .= 'error type=BORKED message=empty 
$request /'.\n;
+   $JUNIT['result_xml'] .= '/testcase'.\n;
+   }
+   return 'BORKED';
+   }
+
+   save_text($tmp_post, $request);
+   $cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;
+
} else if (array_key_exists('POST', $section_text)  
!empty($section_text['POST'])) {

$post = trim($section_text['POST']);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Christopher Jones



On 03/19/2012 12:08 PM, Michael Wallner wrote:

Hi Chris,

On 19 March 2012 17:30, Christopher Joneschristopher.jo...@oracle.com  wrote:

Hi Mike,

Can you update (or get updated) http://qa.php.net/phpt_details.php
with this feature?


Thanks again for the heads up!  Could you please also reveal how to
get there from the homepage?
I'm just curious... ;)



It's way too buried for my liking, but the path is:

http://qa.php.net/
http://qa.php.net/howtohelp.php
http://qa.php.net/write-test.php

Then down in the PHPT structure details section is a link title here to
http://qa.php.net/phpt_details.php

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Michael Wallner
Hi Chris,

On 19 March 2012 17:30, Christopher Jones christopher.jo...@oracle.com wrote:
 Hi Mike,

 Can you update (or get updated) http://qa.php.net/phpt_details.php
 with this feature?

Thanks again for the heads up!  Could you please also reveal how to
get there from the homepage?
I'm just curious... ;)

-- 
Regards,
Mike

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-17 Thread Michael Wallner
mike Sat, 17 Mar 2012 09:35:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324319

Log:
add --PUT-- section support based on POST_RAW

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) {
+
+   if (empty($env['CONTENT_TYPE'])  
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
+   $env['CONTENT_TYPE'] = trim(str_replace(\r, 
'', $res[1]));
+   continue;
+   }
+
+   if ($started) {
+   $request .= \n;
+   }
+
+   $started = true;
+   $request .= $line;
+   }
+
+   $env['CONTENT_LENGTH'] = strlen($request);
+   $env['REQUEST_METHOD'] = 'PUT';
+
+   if (empty($request)) {
+   if ($JUNIT) {
+   $JUNIT['test_total']++;
+   $JUNIT['test_error']++;
+   $JUNIT['result_xml'] .= 'testcase 
classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' 
time='.$test_execution_time.''.\n;
+   $JUNIT['result_xml'] .= 'error type=BORKED 
message=empty $request /'.\n;
+   $JUNIT['result_xml'] .= '/testcase'.\n;
+   }
+   return 'BORKED';
+   }
+
+   save_text($tmp_post, $request);
+   $cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;
+
} else if (array_key_exists('POST', $section_text)  
!empty($section_text['POST'])) {

$post = trim($section_text['POST']);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 05:44:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=320475

Log:
This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=13224861637r=1w=2.

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-12-06 02:18:08 UTC (rev 320474)
+++ php/php-src/trunk/run-tests.php 2011-12-06 05:44:54 UTC (rev 320475)
@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-12-01 Thread Felipe Pena
felipe   Thu, 01 Dec 2011 15:47:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=320252

Log:
- Replace possible esc char to esc in the XML output

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-12-01 15:38:17 UTC (rev 
320251)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-12-01 15:47:58 UTC (rev 
320252)
@@ -2100,11 +2100,11 @@
}
elseif (in_array('FAIL', $restype)) {
$JUNIT['test_fail']++;
-   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/failure'.\n;
+   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/failure'.\n;
}
else{
$JUNIT['test_error']++;
-   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/error'.\n;
+   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/error'.\n;
}
$JUNIT['result_xml'] .= '/testcase'.\n;
}

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-12-01 15:38:17 UTC (rev 
320251)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-12-01 15:47:58 UTC (rev 
320252)
@@ -2100,11 +2100,11 @@
}
elseif (in_array('FAIL', $restype)) {
$JUNIT['test_fail']++;
-   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/failure'.\n;
+   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/failure'.\n;
}
else{
$JUNIT['test_error']++;
-   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/error'.\n;
+   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/error'.\n;
}
$JUNIT['result_xml'] .= '/testcase'.\n;
}

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-12-01 15:38:17 UTC (rev 320251)
+++ php/php-src/trunk/run-tests.php 2011-12-01 15:47:58 UTC (rev 320252)
@@ -2100,11 +2100,11 @@
}
elseif (in_array('FAIL', $restype)) {
$JUNIT['test_fail']++;
-   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/failure'.\n;
+   $JUNIT['result_xml'] .= 'failure 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/failure'.\n;
}
else{
$JUNIT['test_error']++;
-   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.$diff.\n.']]/error'.\n;
+   $JUNIT['result_xml'] .= 'error 
type='.$restype[0].'ED 
message='.$info.'![CDATA['.\n.preg_replace('/\e/', 'esc', 
$diff).\n.']]/error'.\n;
}
$JUNIT['result_xml'] .= '/testcase'.\n;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-11-26 Thread Felipe Pena
felipe   Sat, 26 Nov 2011 17:56:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319964

Log:
- Fixed bug #55788 (test redirects should abide SHOW_ONLY_GROUPS in 
run-tests.php)
  patch by: tyrael at php.net

Bug: https://bugs.php.net/55788 (Open) test redirects should abide 
SHOW_ONLY_GROUPS in run-tests.php
  
Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-11-26 17:48:52 UTC (rev 
319963)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-11-26 17:56:43 UTC (rev 
319964)
@@ -678,7 +678,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.

@@ -2384,24 +2384,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, trtd 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, trtd 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)

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-11-26 17:48:52 UTC (rev 
319963)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-11-26 17:56:43 UTC (rev 
319964)
@@ -678,7 +678,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.

@@ -2384,24 +2384,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, trtd 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, trtd 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)

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-11-26 17:48:52 UTC (rev 319963)
+++ php/php-src/trunk/run-tests.php 2011-11-26 17:56:43 UTC (rev 319964)
@@ -678,7 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-11-26 Thread Felipe Pena
felipe   Sat, 26 Nov 2011 20:18:03 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319967

Log:
- Added JUnit output format option
  patch by: Ferenc Kovacs (tyrael at php.net)

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php	2011-11-26 19:04:51 UTC (rev 319966)
+++ php/php-src/branches/PHP_5_3/run-tests.php	2011-11-26 20:18:03 UTC (rev 319967)
@@ -200,6 +200,26 @@
 	$DETAILED = 0;
 }

+// Check whether a junit log is wanted.
+$JUNIT = getenv('TEST_PHP_JUNIT');
+if (empty($JUNIT) || (!file_exists($JUNIT)  !is_writable(dirname($JUNIT))) || (file_exists($JUNIT)  !is_writable($JUNIT)) || !($JUNIT = @fopen($JUNIT, 'w'))) {
+	$JUNIT = FALSE;
+}
+else{
+	$JUNIT = array(
+		'fp'= $JUNIT,
+		'test_total'= 0,
+		'test_pass' = 0,
+		'test_fail' = 0,
+		'test_error'= 0,
+		'test_skip' = 0,
+		'started_at'= microtime(true),
+		'finished_at'   = NULL,
+		'execution_time'= NULL,
+		'result_xml'= '',
+	);
+}
+
 if (getenv('SHOW_ONLY_GROUPS')) {
 	$SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 } else {
@@ -811,6 +831,10 @@
 		if ($output_file != ''  $just_save_results) {
 			save_or_mail_results();
 		}
+
+		if ($JUNIT) {
+			save_junit_xml();
+		}

 		if (getenv('REPORT_EXIT_STATUS') == 1 and preg_match('/FAILED(?: |$)/', implode(' ', $test_results))) {
 			exit(1);
@@ -946,6 +970,10 @@

 save_or_mail_results();

+if ($JUNIT) {
+	save_junit_xml();
+}
+
 if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
 	exit(1);
 }
@@ -1165,6 +1193,7 @@
 	global $leak_check, $temp_source, $temp_target, $cfg, $environment;
 	global $no_clean;
 	global $valgrind_version;
+	global $JUNIT;
 	$temp_filenames = null;
 	$org_file = $file;

@@ -1300,6 +1329,14 @@
 'diff'  = '',
 'info'  = $bork_info [$file],
 		);
+
+		if ($JUNIT) {
+			$JUNIT['test_total']++;
+			$JUNIT['test_error']++;
+			$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested_file, ENT_QUOTES).' time=0'.\n;
+			$JUNIT['result_xml'] .= 'error type=BORKED message='.$bork_info.' /'.\n;
+			$JUNIT['result_xml'] .= '/testcase'.\n;
+		}
 		return 'BORKED';
 	}

@@ -1322,6 +1359,13 @@
 $php = realpath(./sapi/cgi/php-cgi) . ' -C ';
 			} else {
 show_result('SKIP', $tested, $tested_file, reason: CGI not available);
+if ($JUNIT) {
+	$JUNIT['test_total']++;
+	$JUNIT['test_skip']++;
+	$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time=0'.\n;
+	$JUNIT['result_xml'] .= 'skippedCGI not available/skipped'.\n;
+	$JUNIT['result_xml'] .= '/testcase'.\n;
+}
 return 'SKIPPED';
 			}
 		}
@@ -1459,7 +1503,14 @@
 $env['USE_ZEND_ALLOC'] = '1';
 			}

+			if ($JUNIT) {
+$test_started_at	= microtime(true);
+			}
 			$output = system_with_timeout($extra $php $pass_options -q $ini_settings -d display_errors=0 $test_skipif, $env);
+			if ($JUNIT) {
+$test_finished_at   = microtime(true);
+$test_execution_time= number_format($test_finished_at-$test_started_at, 2);
+			}

 			if (!$cfg['keep']['skip']) {
 @unlink($test_skipif);
@@ -1481,6 +1532,13 @@
 	@unlink($test_skipif);
 }

+if ($JUNIT) {
+	$JUNIT['test_total']++;
+	$JUNIT['test_skip']++;
+	$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+	$JUNIT['result_xml'] .= 'skipped![CDATA['.\n.$m[1].\n.']]/skipped'.\n;
+	$JUNIT['result_xml'] .= '/testcase'.\n;
+}
 return 'SKIPPED';
 			}

@@ -1535,6 +1593,12 @@

 			// a redirected test never fails
 			$IN_REDIRECT = false;
+			if ($JUNIT) {
+$JUNIT['test_total']++;
+$JUNIT['test_pass']++;
+$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+$JUNIT['result_xml'] .= '/testcase'.\n;
+			}
 			return 'REDIR';

 		} else {
@@ -1566,6 +1630,13 @@
 'diff'   = '',
 'info'   = $bork_info [$file],
 		);
+		if ($JUNIT) {
+			$JUNIT['test_total']++;
+			$JUNIT['test_error']++;
+			$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+			$JUNIT['result_xml'] .= 'error type=BORKED message='.$bork_info.' /'.\n;
+			$JUNIT['result_xml'] .= '/testcase'.\n;
+		}
 		return 'BORKED';
 	}

@@ -1619,6 +1690,13 @@
 		$env['REQUEST_METHOD'] = 'POST';

 		if (empty($request)) {
+			if ($JUNIT) {
+$JUNIT['test_total']++;
+$JUNIT['test_error']++;
+$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Hannes Magnusson
bjoriThu, 01 Sep 2011 11:00:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=315967

Log:
Seeing thousands of PASS tests flying by is meaningless.
Add an option to only print certain result groups.

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 10:16:21 UTC (rev 
315966)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 11:00:51 UTC (rev 
315967)
@@ -207,6 +207,12 @@
$DETAILED = 0;
 }

+if (getenv('SHOW_ONLY_GROUPS')) {
+   $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
+} else {
+   $SHOW_ONLY_GROUPS = array();
+}
+
 // Check whether user test dirs are requested.
 if (getenv('TEST_PHP_USER')) {
$user_tests = explode (',', getenv('TEST_PHP_USER'));
@@ -560,6 +566,9 @@
case 'd':
$ini_overwrites[] = $argv[++$i];
break;
+   case 'g':
+   $SHOW_ONLY_GROUPS = explode(,, 
$argv[++$i]);;
+   break;
//case 'h'
case '--keep-all':
foreach($cfgfiles as $file) {
@@ -675,6 +684,9 @@
 -d foo=bar  Pass -d option to the php binary (Define INI entry foo
 with value 'bar').

+-g  Comma seperated list of groups to show during test run
+(e.x. FAIL,SKIP).
+
 -m  Test for memory leaks with Valgrind.

 -p phpSpecify PHP executable to run.
@@ -2426,16 +2438,24 @@
 function show_test($test_idx, $shortname)
 {
global $test_cnt;
+   global $line_length;

-   echo TEST $test_idx/$test_cnt [$shortname]\r;
+   $str = TEST $test_idx/$test_cnt [$shortname]\r;
+   $line_length = strlen($str);
+   echo $str;
flush();
 }

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

-   echo $result $tested [$tested_file] $extra\n;
+   if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
+   echo $result $tested [$tested_file] $extra\n;
+   } else {
+   // Write over the last line to avoid random trailing chars on 
next echo
+   echo str_repeat( , $line_length), \r;
+   }

if ($html_output) {


Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 10:16:21 UTC (rev 
315966)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 11:00:51 UTC (rev 
315967)
@@ -207,6 +207,12 @@
$DETAILED = 0;
 }

+if (getenv('SHOW_ONLY_GROUPS')) {
+   $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
+} else {
+   $SHOW_ONLY_GROUPS = array();
+}
+
 // Check whether user test dirs are requested.
 if (getenv('TEST_PHP_USER')) {
$user_tests = explode (',', getenv('TEST_PHP_USER'));
@@ -560,6 +566,9 @@
case 'd':
$ini_overwrites[] = $argv[++$i];
break;
+   case 'g':
+   $SHOW_ONLY_GROUPS = explode(,, 
$argv[++$i]);;
+   break;
//case 'h'
case '--keep-all':
foreach($cfgfiles as $file) {
@@ -675,6 +684,9 @@
 -d foo=bar  Pass -d option to the php binary (Define INI entry foo
 with value 'bar').

+-g  Comma seperated list of groups to show during test run
+(e.x. FAIL,SKIP).
+
 -m  Test for memory leaks with Valgrind.

 -p phpSpecify PHP executable to run.
@@ -2426,16 +2438,24 @@
 function show_test($test_idx, $shortname)
 {
global $test_cnt;
+   global $line_length;

-   echo TEST $test_idx/$test_cnt [$shortname]\r;
+   $str = TEST $test_idx/$test_cnt [$shortname]\r;
+   $line_length = strlen($str);
+   echo $str;
flush();
 }

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

-   echo $result $tested 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Pierre Joye
good idea!

please add it as a command line option as well, maybe using a verbose option

On Thu, Sep 1, 2011 at 1:00 PM, Hannes Magnusson bj...@php.net wrote:
 bjori                                    Thu, 01 Sep 2011 11:00:51 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=315967

 Log:
 Seeing thousands of PASS tests flying by is meaningless.
 Add an option to only print certain result groups.

 Changed paths:
    U   php/php-src/branches/PHP_5_3/run-tests.php
    U   php/php-src/branches/PHP_5_4/run-tests.php
    U   php/php-src/trunk/run-tests.php

 Modified: php/php-src/branches/PHP_5_3/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 10:16:21 UTC (rev 
 315966)
 +++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 11:00:51 UTC (rev 
 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo TEST $test_idx/$test_cnt [$shortname]\r;
 +       $str = TEST $test_idx/$test_cnt [$shortname]\r;
 +       $line_length = strlen($str);
 +       echo $str;
        flush();
  }

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

 -       echo $result $tested [$tested_file] $extra\n;
 +       if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
 +               echo $result $tested [$tested_file] $extra\n;
 +       } else {
 +               // Write over the last line to avoid random trailing chars on 
 next echo
 +               echo str_repeat( , $line_length), \r;
 +       }

        if ($html_output) {


 Modified: php/php-src/branches/PHP_5_4/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 10:16:21 UTC (rev 
 315966)
 +++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 11:00:51 UTC (rev 
 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo TEST $test_idx/$test_cnt [$shortname]\r;
 +       $str = TEST $test_idx/$test_cnt [$shortname]\r;
 +       $line_length = strlen($str);
 +       echo $str;
        flush();
  }

  function show_result($result, $tested, 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Hannes Magnusson
It is, -g

so, you can either do $ SHOW_ONLY_GROUPS=FAIL,WARN make test
or via run-tets, $ TEST_PHP_EXECUTABLE=auto php run-tests.php -g XFAIL,SKIP

-Hannes


On Thu, Sep 1, 2011 at 13:06, Pierre Joye pierre@gmail.com wrote:
 good idea!

 please add it as a command line option as well, maybe using a verbose option

 On Thu, Sep 1, 2011 at 1:00 PM, Hannes Magnusson bj...@php.net wrote:
 bjori                                    Thu, 01 Sep 2011 11:00:51 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=315967

 Log:
 Seeing thousands of PASS tests flying by is meaningless.
 Add an option to only print certain result groups.

 Changed paths:
    U   php/php-src/branches/PHP_5_3/run-tests.php
    U   php/php-src/branches/PHP_5_4/run-tests.php
    U   php/php-src/trunk/run-tests.php

 Modified: php/php-src/branches/PHP_5_3/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 10:16:21 UTC (rev 
 315966)
 +++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 11:00:51 UTC (rev 
 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo TEST $test_idx/$test_cnt [$shortname]\r;
 +       $str = TEST $test_idx/$test_cnt [$shortname]\r;
 +       $line_length = strlen($str);
 +       echo $str;
        flush();
  }

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

 -       echo $result $tested [$tested_file] $extra\n;
 +       if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
 +               echo $result $tested [$tested_file] $extra\n;
 +       } else {
 +               // Write over the last line to avoid random trailing chars 
 on next echo
 +               echo str_repeat( , $line_length), \r;
 +       }

        if ($html_output) {


 Modified: php/php-src/branches/PHP_5_4/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 10:16:21 UTC (rev 
 315966)
 +++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 11:00:51 UTC (rev 
 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Pierre Joye
ah right, I miss this part of the patch. I would suggest -v instead
and add a level of verbosity (less means no output but failed tests
for example).

On Thu, Sep 1, 2011 at 1:13 PM, Hannes Magnusson bj...@php.net wrote:
 It is, -g

 so, you can either do $ SHOW_ONLY_GROUPS=FAIL,WARN make test
 or via run-tets, $ TEST_PHP_EXECUTABLE=auto php run-tests.php -g XFAIL,SKIP

 -Hannes


 On Thu, Sep 1, 2011 at 13:06, Pierre Joye pierre@gmail.com wrote:
 good idea!

 please add it as a command line option as well, maybe using a verbose option

 On Thu, Sep 1, 2011 at 1:00 PM, Hannes Magnusson bj...@php.net wrote:
 bjori                                    Thu, 01 Sep 2011 11:00:51 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=315967

 Log:
 Seeing thousands of PASS tests flying by is meaningless.
 Add an option to only print certain result groups.

 Changed paths:
    U   php/php-src/branches/PHP_5_3/run-tests.php
    U   php/php-src/branches/PHP_5_4/run-tests.php
    U   php/php-src/trunk/run-tests.php

 Modified: php/php-src/branches/PHP_5_3/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 10:16:21 UTC 
 (rev 315966)
 +++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 11:00:51 UTC 
 (rev 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo TEST $test_idx/$test_cnt [$shortname]\r;
 +       $str = TEST $test_idx/$test_cnt [$shortname]\r;
 +       $line_length = strlen($str);
 +       echo $str;
        flush();
  }

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

 -       echo $result $tested [$tested_file] $extra\n;
 +       if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
 +               echo $result $tested [$tested_file] $extra\n;
 +       } else {
 +               // Write over the last line to avoid random trailing chars 
 on next echo
 +               echo str_repeat( , $line_length), \r;
 +       }

        if ($html_output) {


 Modified: php/php-src/branches/PHP_5_4/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 10:16:21 UTC 
 (rev 315966)
 +++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 11:00:51 UTC 
 (rev 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Hannes Magnusson
I did want to use -v at first, but that has a completely different
meaning already.
Its really only useful when looking at what is going on in a single
testcase to debug run-tests :]

-Hannes

On Thu, Sep 1, 2011 at 13:26, Pierre Joye pierre@gmail.com wrote:
 ah right, I miss this part of the patch. I would suggest -v instead
 and add a level of verbosity (less means no output but failed tests
 for example).

 On Thu, Sep 1, 2011 at 1:13 PM, Hannes Magnusson bj...@php.net wrote:
 It is, -g

 so, you can either do $ SHOW_ONLY_GROUPS=FAIL,WARN make test
 or via run-tets, $ TEST_PHP_EXECUTABLE=auto php run-tests.php -g XFAIL,SKIP

 -Hannes


 On Thu, Sep 1, 2011 at 13:06, Pierre Joye pierre@gmail.com wrote:
 good idea!

 please add it as a command line option as well, maybe using a verbose option

 On Thu, Sep 1, 2011 at 1:00 PM, Hannes Magnusson bj...@php.net wrote:
 bjori                                    Thu, 01 Sep 2011 11:00:51 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=315967

 Log:
 Seeing thousands of PASS tests flying by is meaningless.
 Add an option to only print certain result groups.

 Changed paths:
    U   php/php-src/branches/PHP_5_3/run-tests.php
    U   php/php-src/branches/PHP_5_4/run-tests.php
    U   php/php-src/trunk/run-tests.php

 Modified: php/php-src/branches/PHP_5_3/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 10:16:21 UTC 
 (rev 315966)
 +++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 11:00:51 UTC 
 (rev 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as $file) {
 @@ -675,6 +684,9 @@
     -d foo=bar  Pass -d option to the php binary (Define INI entry foo
                 with value 'bar').

 +    -g          Comma seperated list of groups to show during test run
 +                (e.x. FAIL,SKIP).
 +
     -m          Test for memory leaks with Valgrind.

     -p php    Specify PHP executable to run.
 @@ -2426,16 +2438,24 @@
  function show_test($test_idx, $shortname)
  {
        global $test_cnt;
 +       global $line_length;

 -       echo TEST $test_idx/$test_cnt [$shortname]\r;
 +       $str = TEST $test_idx/$test_cnt [$shortname]\r;
 +       $line_length = strlen($str);
 +       echo $str;
        flush();
  }

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

 -       echo $result $tested [$tested_file] $extra\n;
 +       if (!$SHOW_ONLY_GROUPS || in_array($result, $SHOW_ONLY_GROUPS)) {
 +               echo $result $tested [$tested_file] $extra\n;
 +       } else {
 +               // Write over the last line to avoid random trailing chars 
 on next echo
 +               echo str_repeat( , $line_length), \r;
 +       }

        if ($html_output) {


 Modified: php/php-src/branches/PHP_5_4/run-tests.php
 ===
 --- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 10:16:21 UTC 
 (rev 315966)
 +++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 11:00:51 UTC 
 (rev 315967)
 @@ -207,6 +207,12 @@
        $DETAILED = 0;
  }

 +if (getenv('SHOW_ONLY_GROUPS')) {
 +       $SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 +} else {
 +       $SHOW_ONLY_GROUPS = array();
 +}
 +
  // Check whether user test dirs are requested.
  if (getenv('TEST_PHP_USER')) {
        $user_tests = explode (',', getenv('TEST_PHP_USER'));
 @@ -560,6 +566,9 @@
                                case 'd':
                                        $ini_overwrites[] = $argv[++$i];
                                        break;
 +                               case 'g':
 +                                       $SHOW_ONLY_GROUPS = explode(,, 
 $argv[++$i]);;
 +                                       break;
                                //case 'h'
                                case '--keep-all':
                                        foreach($cfgfiles as 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Hannes Magnusson
bjoriThu, 01 Sep 2011 13:06:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=315984

Log:
Move the XFAILED printout way up the list so we can actually notice the really 
failing ones

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 13:05:54 UTC (rev 
315983)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 13:06:12 UTC (rev 
315984)
@@ -2305,6 +2305,18 @@
 ';
$failed_test_summary = '';

+   if (count($PHP_FAILED_TESTS['XFAILED'])) {
+   $failed_test_summary .= '
+=
+EXPECTED FAILED TEST SUMMARY
+-
+';
+   foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) {
+   $failed_test_summary .= $failed_test_data['test_name'] 
. $failed_test_data['info'] . \n;
+   }
+   $failed_test_summary .=  
=\n;
+   }
+
if (count($PHP_FAILED_TESTS['BORKED'])) {
$failed_test_summary .= '
 =
@@ -2329,18 +2341,6 @@
}
$failed_test_summary .=  
=\n;
}
-   if (count($PHP_FAILED_TESTS['XFAILED'])) {
-   $failed_test_summary .= '
-=
-EXPECTED FAILED TEST SUMMARY
--
-';
-   foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) {
-   $failed_test_summary .= $failed_test_data['test_name'] 
. $failed_test_data['info'] . \n;
-   }
-   $failed_test_summary .=  
=\n;
-   }
-
if (count($PHP_FAILED_TESTS['WARNED'])) {
$failed_test_summary .= '
 =

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 13:05:54 UTC (rev 
315983)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 13:06:12 UTC (rev 
315984)
@@ -2305,6 +2305,18 @@
 ';
$failed_test_summary = '';

+   if (count($PHP_FAILED_TESTS['XFAILED'])) {
+   $failed_test_summary .= '
+=
+EXPECTED FAILED TEST SUMMARY
+-
+';
+   foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) {
+   $failed_test_summary .= $failed_test_data['test_name'] 
. $failed_test_data['info'] . \n;
+   }
+   $failed_test_summary .=  
=\n;
+   }
+
if (count($PHP_FAILED_TESTS['BORKED'])) {
$failed_test_summary .= '
 =
@@ -2329,18 +2341,6 @@
}
$failed_test_summary .=  
=\n;
}
-   if (count($PHP_FAILED_TESTS['XFAILED'])) {
-   $failed_test_summary .= '
-=
-EXPECTED FAILED TEST SUMMARY
--
-';
-   foreach ($PHP_FAILED_TESTS['XFAILED'] as $failed_test_data) {
-   $failed_test_summary .= $failed_test_data['test_name'] 
. $failed_test_data['info'] . \n;
-   }
-   $failed_test_summary .=  
=\n;
-   }
-
if (count($PHP_FAILED_TESTS['WARNED'])) {
$failed_test_summary .= '
 =

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-09-01 13:05:54 UTC (rev 315983)
+++ php/php-src/trunk/run-tests.php 2011-09-01 13:06:12 UTC (rev 315984)
@@ -2305,6 +2305,18 @@
 ';
$failed_test_summary = '';

+   if (count($PHP_FAILED_TESTS['XFAILED'])) {
+   $failed_test_summary .= '

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-09-01 Thread Johannes Schlüter
johannes Thu, 01 Sep 2011 14:52:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=315995

Log:
Improve speed of finding tests (no more CVS, we're on svn now)

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 14:32:05 UTC (rev 
315994)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-09-01 14:52:55 UTC (rev 
315995)
@@ -866,7 +866,7 @@

while (($name = readdir($o)) !== false) {

-   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', 'CVS'))) {
+   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', '.svn'))) {
$skip_ext = ($is_ext_dir  
!in_array(strtolower($name), $exts_to_test));
if ($skip_ext) {
$exts_skipped++;

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 14:32:05 UTC (rev 
315994)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-09-01 14:52:55 UTC (rev 
315995)
@@ -866,7 +866,7 @@

while (($name = readdir($o)) !== false) {

-   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', 'CVS'))) {
+   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', '.svn'))) {
$skip_ext = ($is_ext_dir  
!in_array(strtolower($name), $exts_to_test));
if ($skip_ext) {
$exts_skipped++;

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-09-01 14:32:05 UTC (rev 315994)
+++ php/php-src/trunk/run-tests.php 2011-09-01 14:52:55 UTC (rev 315995)
@@ -866,7 +866,7 @@

while (($name = readdir($o)) !== false) {

-   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', 'CVS'))) {
+   if (is_dir({$dir}/{$name})  !in_array($name, array('.', 
'..', '.svn'))) {
$skip_ext = ($is_ext_dir  
!in_array(strtolower($name), $exts_to_test));
if ($skip_ext) {
$exts_skipped++;
@@ -1239,7 +1239,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, STRING_TYPE);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-08-09 Thread Nuno Lopes
nlopess  Tue, 09 Aug 2011 21:53:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=314690

Log:
terminate timeouting processes with SIGKILL (9)

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-08-09 21:35:31 UTC (rev 
314689)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-08-09 21:53:44 UTC (rev 
314690)
@@ -1080,7 +1080,7 @@
} else if ($n === 0) {
/* timed out */
$data .= b\n ** ERROR: process timed out **\n;
-   proc_terminate($proc);
+   proc_terminate($proc, 9);
return $data;
} else if ($n  0) {
$line = (binary) fread($pipes[1], 8192);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-08-09 21:35:31 UTC (rev 
314689)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-08-09 21:53:44 UTC (rev 
314690)
@@ -1080,7 +1080,7 @@
} else if ($n === 0) {
/* timed out */
$data .= b\n ** ERROR: process timed out **\n;
-   proc_terminate($proc);
+   proc_terminate($proc, 9);
return $data;
} else if ($n  0) {
$line = (binary) fread($pipes[1], 8192);

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-08-09 21:35:31 UTC (rev 314689)
+++ php/php-src/trunk/run-tests.php 2011-08-09 21:53:44 UTC (rev 314690)
@@ -1082,7 +1082,7 @@
} else if ($n === 0) {
/* timed out */
$data .= b\n ** ERROR: process timed out **\n;
-   proc_terminate($proc);
+   proc_terminate($proc, 9);
return $data;
} else if ($n  0) {
$line = (binary) fread($pipes[1], 8192);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-07-01 Thread Felipe Pena
felipe   Fri, 01 Jul 2011 23:13:53 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=312789

Log:
- Fixed bug #55080 (Deprecated call in run--test.php)
  patch by: fedora at famillecollet dot com

Bug: https://bugs.php.net/55080 (Open) Deprecated call in run--test.php
  
Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-07-01 23:10:31 UTC (rev 
312788)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-07-01 23:13:53 UTC (rev 
312789)
@@ -489,7 +489,7 @@
$argv = array(__FILE__);
}

-   $argv = array_merge($argv, split(' ', getenv('TEST_PHP_ARGS')));
+   $argv = array_merge($argv, explode(' ', getenv('TEST_PHP_ARGS')));
$argc = count($argv);
 }


Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-07-01 23:10:31 UTC (rev 
312788)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-07-01 23:13:53 UTC (rev 
312789)
@@ -489,7 +489,7 @@
$argv = array(__FILE__);
}

-   $argv = array_merge($argv, split(' ', getenv('TEST_PHP_ARGS')));
+   $argv = array_merge($argv, explode(' ', getenv('TEST_PHP_ARGS')));
$argc = count($argv);
 }


Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-07-01 23:10:31 UTC (rev 312788)
+++ php/php-src/trunk/run-tests.php 2011-07-01 23:13:53 UTC (rev 312789)
@@ -491,7 +491,7 @@
$argv = array(__FILE__);
}

-   $argv = array_merge($argv, split(' ', getenv('TEST_PHP_ARGS')));
+   $argv = array_merge($argv, explode(' ', getenv('TEST_PHP_ARGS')));
$argc = count($argv);
 }


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-06-24 Thread Christopher Jones
sixd Fri, 24 Jun 2011 23:10:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=312447

Log:
Add http_proxy env var support to run-tests.php result submission

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php	2011-06-24 22:27:57 UTC (rev 312446)
+++ php/php-src/branches/PHP_5_3/run-tests.php	2011-06-24 23:10:37 UTC (rev 312447)
@@ -312,6 +312,7 @@

 define('PHP_QA_EMAIL', 'qa-repo...@lists.php.net');
 define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
+define('QA_REPORTS_PAGE', 'http://qa.php.net/reports');

 function save_or_mail_results()
 {
@@ -324,9 +325,11 @@
 		if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) {
 			echo \nYou may have found a problem in PHP.;
 		}
-		echo \nWe would like to send this report automatically to the\n;
-		echo PHP QA team, to give us a better understanding of how\nthe test cases are doing. If you don't want to send it\n;
-		echo immediately, you can choose \s\ to save the report to\na file that you can send us later.\n;
+		echo \nThis report can be automatically sent to the PHP QA team at\n;
+		echo QA_REPORTS_PAGE .  and http://news.php.net/php.qa.reports\n;;
+		echo This gives us a better understanding of PHP's behavior.\n;
+		echo If you don't want to send the report immediately you can choose\n;
+		echo option \s\ to save it.	You can then email it to . PHP_QA_EMAIL .  later.\n;
 		echo Do you want to send this report now? [Yns]: ;
 		flush();

@@ -951,14 +954,24 @@
 {
 	$url_bits = parse_url(QA_SUBMISSION_PAGE);

-	if (empty($url_bits['port'])) {
-		$url_bits['port'] = 80;
-	}
+if (($proxy = getenv('http_proxy'))) {
+$proxy = parse_url($proxy);
+$path = $url_bits['host'].$url_bits['path'];
+$host = $proxy['host'];
+if (empty($proxy['port'])) {
+$proxy['port'] = 80;
+}
+$port = $proxy['port'];
+} else {
+$path = $url_bits['path'];
+$host = $url_bits['host'];
+$port = empty($url_bits['port']) ? 80 : $port = $url_bits['port'];
+}

 	$data = php_test_data= . urlencode(base64_encode(str_replace(\00, '[0x0]', $data)));
 	$data_length = strlen($data);

-	$fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10);
+	$fs = fsockopen($host, $port, $errno, $errstr, 10);

 	if (!$fs) {
 		return false;
@@ -966,9 +979,9 @@

 	$php_version = urlencode(TESTED_PHP_VERSION);

-	echo \nPosting to {$url_bits['host']} {$url_bits['path']}\n;
-	fwrite($fs, POST  . $url_bits['path'] . ?status=$statusversion=$php_version HTTP/1.1\r\n);
-	fwrite($fs, Host:  . $url_bits['host'] . \r\n);
+	echo \nPosting to . QA_SUBMISSION_PAGE . \n;
+	fwrite($fs, POST  . $path . ?status=$statusversion=$php_version HTTP/1.1\r\n);
+	fwrite($fs, Host:  . $host . \r\n);
 	fwrite($fs, User-Agent: QA Browser 0.1\r\n);
 	fwrite($fs, Content-Type: application/x-www-form-urlencoded\r\n);
 	fwrite($fs, Content-Length:  . $data_length . \r\n\r\n);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php	2011-06-24 22:27:57 UTC (rev 312446)
+++ php/php-src/branches/PHP_5_4/run-tests.php	2011-06-24 23:10:37 UTC (rev 312447)
@@ -312,6 +312,7 @@

 define('PHP_QA_EMAIL', 'qa-repo...@lists.php.net');
 define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
+define('QA_REPORTS_PAGE', 'http://qa.php.net/reports');

 function save_or_mail_results()
 {
@@ -324,9 +325,11 @@
 		if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) {
 			echo \nYou may have found a problem in PHP.;
 		}
-		echo \nWe would like to send this report automatically to the\n;
-		echo PHP QA team, to give us a better understanding of how\nthe test cases are doing. If you don't want to send it\n;
-		echo immediately, you can choose \s\ to save the report to\na file that you can send us later.\n;
+		echo \nThis report can be automatically sent to the PHP QA team at\n;
+		echo QA_REPORTS_PAGE .  and http://news.php.net/php.qa.reports\n;;
+		echo This gives us a better understanding of PHP's behavior.\n;
+		echo If you don't want to send the report immediately you can choose\n;
+		echo option \s\ to save it.	You can then email it to . PHP_QA_EMAIL .  later.\n;
 		echo Do you want to send this report now? [Yns]: ;
 		flush();

@@ -951,14 +954,24 @@
 {
 	$url_bits = parse_url(QA_SUBMISSION_PAGE);

-	if (empty($url_bits['port'])) {
-		$url_bits['port'] = 80;
-	}
+if (($proxy = getenv('http_proxy'))) {
+$proxy =