cvs: pear-core / package-PEAR.xml package2.xml /PEAR RunTest.php

From: Date: Wed, 14 Feb 2007 06:10:16 +0000
Subject: cvs: pear-core / package-PEAR.xml package2.xml /PEAR RunTest.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-5418@lists.php.net to get a copy of this message
cellog Wed Feb 14 06:10:16 2007 UTC Modified files: /pear-core package-PEAR.xml package2.xml /pear-core/PEAR RunTest.php Log: * fix Bug #9971: Improve run-tests diffs of EXPECTF sections http://cvs.php.net/viewvc.cgi/pear-core/package-PEAR.xml?r1=1.429&r2=1.430&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.429 pear-core/package-PEAR.xml:1.430 --- pear-core/package-PEAR.xml:1.429 Tue Feb 13 04:30:05 2007 +++ pear-core/package-PEAR.xml Wed Feb 14 06:10:16 2007 @@ -87,6 +87,7 @@ * fix Bug #9841: incorrect dependency information shown on uninstall * fix Bug #9957: E_NOTICE on remote-list * fix Bug #9959: Channel name not shown when upgrading + * fix Bug #9971: Improve run-tests diffs of EXPECTF sections * fix Bug #10012: pear package: tokenizer should be enabled * fix Bug #10081: installer dies on uninstall (recursion too deep) </notes> http://cvs.php.net/viewvc.cgi/pear-core/package2.xml?r1=1.323&r2=1.324&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.323 pear-core/package2.xml:1.324 --- pear-core/package2.xml:1.323 Tue Feb 13 04:30:05 2007 +++ pear-core/package2.xml Wed Feb 14 06:10:16 2007 @@ -96,6 +96,7 @@ * fix Bug #9841: incorrect dependency information shown on uninstall * fix Bug #9957: E_NOTICE on remote-list * fix Bug #9959: Channel name not shown when upgrading + * fix Bug #9971: Improve run-tests diffs of EXPECTF sections * fix Bug #10012: pear package: tokenizer should be enabled * fix Bug #10081: installer dies on uninstall (recursion too deep) </notes> http://cvs.php.net/viewvc.cgi/pear-core/PEAR/RunTest.php?r1=1.23&r2=1.24&diff_format=u Index: pear-core/PEAR/RunTest.php diff -u pear-core/PEAR/RunTest.php:1.23 pear-core/PEAR/RunTest.php:1.24 --- pear-core/PEAR/RunTest.php:1.23 Tue Mar 28 05:33:42 2006 +++ pear-core/PEAR/RunTest.php Wed Feb 14 06:10:16 2007 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: RunTest.php,v 1.23 2006/03/28 05:33:42 cellog Exp $ + * @version CVS: $Id: RunTest.php,v 1.24 2007/02/14 06:10:16 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.3 */ @@ -100,6 +100,7 @@ 'SKIPIF' => '', 'GET' => '', 'ARGS' => '', + 'INI' => '', 'CLEAN' => '', ); @@ -360,9 +361,13 @@ if (!$log = fopen($logname,'w')) { return PEAR::raiseError("Cannot create test log - $logname"); } - fwrite($log, $this->generate_diff($wanted, $output, - isset($section_text['RETURNS']) ? array(trim($section_text['RETURNS']), - $return_value) : null)); + fwrite($log, $this->generate_diff( + $wanted, + $output, + isset($section_text['RETURNS']) ? + array(trim($section_text['RETURNS']), $return_value) : null, + isset($section_text['EXPECTF']) ? $wanted_re : null) + ); fclose($log); } @@ -405,16 +410,27 @@ return $warn ? 'WARNED' : 'FAILED'; } - function generate_diff($wanted, $output, $return_value) + function generate_diff($wanted, $output, $return_value, $wanted_re) { $w = explode("\n", $wanted); $o = explode("\n", $output); + $wr = explode("\n", $wanted_re); $w1 = array_diff_assoc($w,$o); $o1 = array_diff_assoc($o,$w); $w2 = array(); $o2 = array(); - foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] = sprintf("%03d- ", $idx+1).$val; - foreach($o1 as $idx => $val) $o2[sprintf("%03d>",$idx)] = sprintf("%03d+ ", $idx+1).$val; + foreach($w1 as $idx => $val) { + if (!$wanted_re || !isset($wr[$idx]) || !isset($o1[$idx]) || + !preg_match('/^' . $wr[$idx] . '$/', $o1[$idx])) { + $w2[sprintf("%03d<", $idx)] = sprintf("%03d- ", $idx + 1) . $val; + } + } + foreach($o1 as $idx => $val) { + if (!$wanted_re || !isset($wr[$idx]) || + !preg_match('/^' . $wr[$idx] . '$/', $val)) { + $o2[sprintf("%03d>", $idx)] = sprintf("%03d+ ", $idx + 1) . $val; + } + } $diff = array_merge($w2, $o2); ksort($diff); if ($return_value) {

« previous php.pear.core (#5418) next »