Re: cvs: pear /Validate package_AT.xml /Validate/Validate AT.php /Validate/tests validate_AT.phpt

From: Date: Wed, 22 Aug 2007 08:12:26 +0000
Subject: Re: cvs: pear /Validate package_AT.xml /Validate/Validate AT.php /Validate/tests validate_AT.phpt
References: 1 2  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-48487@lists.php.net to get a copy of this message
On Tue, Aug 21, 2007 at 11:26:15PM -0500, Gregory Beaver wrote: > Ken Guest wrote: > > kguest Tue Aug 21 23:01:09 2007 UTC > > > > Modified files: > > /pear/Validate package_AT.xml > > /pear/Validate/Validate AT.php > > /pear/Validate/tests validate_AT.phpt > > Log: > > Bug #11885 coding standard errors plus DATADIR reference won't work when testing > > from CVS > > [snip] > > > - $file = '@DATADIR@/Validate_AT/AT_postcodes.txt'; > > + if ($dataDir != null && (is_file($dataDir . > > '/AT_postcodes.txt'))) { > > + $file = $dataDir . '/AT_postcodes.txt'; > > + } else { > > + $file = '@DATADIR@/Validate_AT/AT_postcodes.txt'; > > + } > > $postcodes = array_map('trim', file($file)); > > Hi Ken, > > This is not the best practice. When testing code from CVS, the best way > to do it is have a console window open (or dos box on windows) in which > you have typed: > > pear up -f package_AT.xml > > in the Validate CVS checkout directory. Then, when you make a change, > hit <up arrow> <enter> and run your examples after your Validate_AT has > updated. With these two additional keystrokes per edit, you can both > ensure your package.xml is valid and that it works as expected from > installation, and remove debugging hacks like the thing above. This is for the PEAR-wide unit test suite that is directly run from cvs; unless the test suite is adapted to install each package, test it and then uninstall the package there is probably no option but to have solutions like this in place. > Ask on irc if you want more detailed tips on this - I think it's > probably the most important thing I've learned while working in PEAR. > Never run a package off of CVS unless you also intend users to run it > from an unzip-and-go, then you should test both ways when making a change. Thanks for your advice Greg - I hope there is a faq [or some other stable form of knowledge repository] of these tips rather than having to rely on IRC and all that it entails. k. -- Ken Guest Mobile: +353 86 8252 141 http://blogs.linux.ie/kenguest/ Irish PHP Users Group http://www.php.ie

« previous php.pear.cvs (#48487) next »