| Nuno Lopes 2007-01-30, 7:00 pm |
| nlopess Tue Jan 30 18:15:49 2007 UTC
Modified files:
/php-gcov-web/cron tests.php cron.php
Log:
add support for multiple errors on the same test (introduced yesterday on php6's run-tests.php)
http://cvs.php.net/viewvc.cgi/php-g...5&diff_format=u
Index: php-gcov-web/cron/tests.php
diff -u php-gcov-web/cron/tests.php:1.4 php-gcov-web/cron/tests.php:1.5
--- php-gcov-web/cron/tests.php:1.4 Sun Dec 24 17:19:17 2006
+++ php-gcov-web/cron/tests.php Tue Jan 30 18:15:49 2007
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| PHP QA GCOV Website |
+----------------------------------------------------------------------+
- | Copyright (c) 2005-2006 The PHP Group |
+ | Copyright (c) 2005-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,20 +18,21 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tests.php,v 1.4 2006/12/24 17:19:17 nlopess Exp $ */
+/* $Id: tests.php,v 1.5 2007/01/30 18:15:49 nlopess Exp $ */
// Tests generation file
// $data: contains the contents of $tmpdir/php_test.log
$fail_tests = array();
$skip_tests = array();
-$tests_re = '/(?P<status>FAIL|PASS|SKIP)(?::(?P<testtype>[a-z|A-Z]))? (?P<title>.+) \[(?P<file>[^\]]+)\](?: reason: (?P<reason>.+))?/';
+$valgrind = array();
+$tests_re = '/^(?P<status>[A-Z&]+)(?::(?P<testtype>[a-z|A-Z]))? (?P<title>.+) \[(?P<file>[^\]]+)\](?: reason: (?P<reason>.+))?/m';
preg_match_all($tests_re, $data, $tests, PREG_SET_ORDER);
foreach ($tests as $test) {
- $status = $test['status']; // FAIL, PASS or SKIP
+ $status = $test['status']; // FAIL, LEAK, PASS, SKIP, ...
$title = $test['title'];
$reason = isset($test['reason']) ? $test['reason'] : '';
@@ -48,7 +49,7 @@
}
// Failed tests provide more content then passed tests
- if ($status === 'FAIL') {
+ if (strpos($status, 'FAIL') !== false) {
$difference = @file_get_contents($report_file.'diff');
$expected = @file_get_contents($report_file.'exp');
$output = @file_get_contents($report_file.'out');
@@ -58,7 +59,16 @@
$fail_tests[$test['file']] = array($testtype, $title, $difference, $expected, $output, $script);
- } elseif ($status === 'SKIP') {
+ }
+
+ if (strpos($status, 'LEAK') !== false) {
+ $report = @file_get_contents($report_file.'mem');
+ $script = @file_get_contents($base.'php');
+
+ $valgrind[$test['file']] = array($title, $testtype, $script, $report);
+ }
+
+ if (strpos($status, 'SKIP') !== false) {
$skip = @file_get_contents($report_file.'skip.php');
$skip_tests[$test['file']] = array($skip, $reason);
@@ -69,7 +79,11 @@
// sort by filename
ksort($skip_tests);
ksort($fail_tests);
+ksort($valgrind);
+
+$totalnumleaks = count($valgrind);
// now write the raw data to thw www dir
file_put_contents("$outdir/skip.inc", serialize($skip_tests));
file_put_contents("$outdir/fail.inc", serialize($fail_tests));
+file_put_contents("$outdir/valgrind.inc", serialize($valgrind));
http://cvs.php.net/viewvc.cgi/php-g...8&diff_format=u
Index: php-gcov-web/cron/cron.php
diff -u php-gcov-web/cron/cron.php:1.7 php-gcov-web/cron/cron.php:1.8
--- php-gcov-web/cron/cron.php:1.7 Fri Dec 29 23:28:45 2006
+++ php-gcov-web/cron/cron.php Tue Jan 30 18:15:49 2007
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| PHP QA GCOV Website |
+----------------------------------------------------------------------+
- | Copyright (c) 2005-2006 The PHP Group |
+ | Copyright (c) 2005-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cron.php,v 1.7 2006/12/29 23:28:45 nlopess Exp $ */
+/* $Id: cron.php,v 1.8 2007/01/30 18:15:49 nlopess Exp $ */
if ($argc != 7)
@@ -41,7 +41,7 @@
$totalnumerrors = 0; // Total number of errors (compile_errors.php)
$totalnumwarnings = 0; // Total number of warnings (compile_errors.php)
-$totalnumleaks = NULL; // Total number of memory leaks (valgrind.php)
+$totalnumleaks = NULL; // Total number of memory leaks (tests.php)
$totalnumfailures = NULL; // Total number of test failures (tests.php)
$configureinfo = 'N/A'; // Information regarding configure (system.php)
@@ -78,8 +78,6 @@
{
// Run the PHP tests
require $workdir.'/tests.php';
- // Run the valgrind code
- require $workdir.'/valgrind.php';
// Grab the code coverage rate
if(preg_match('/Overall coverage rate: .+ \((.+)%\)/', $data, $matches))
|