Re: Log2 Update

From: Date: Sat, 26 Sep 2009 13:05:22 +0000
Subject: Re: Log2 Update
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52896@lists.php.net to get a copy of this message
On Sat, Sep 26, 2009 at 7:52 AM, Brandon Savage <brandon@brandonsavage.net>wrote: > After much consideration, I've decided that the best course of action for > an E_STRICT compatible PHP 5 Log package is to simply convert the existing > log package. I'll be doing this over the next week, and I'll post the code > up for review. > > As a side note, is there some sort of secret to executing the regression > tests written in the .phpt format? > > ================================ > Brandon J. Savage > brandon@brandonsavage.net > > Phone: 202.658.7866 > Blog: www.brandonsavage.net > > "Character may be manifested in the great mountains, but it is made in the > small ones." ~ Phillip Brook > > > Hey Brandon, To run the tests, use "pear run-tests -r" from your sandbox's /tests subdirectory. I think that's how most people utilize them. However, it's up to your include_path to determine whether or not your code sandbox is the code that gets tested versus your installed PEAR package gets tested. Due to that, most developers will force an upgrade of the installed package, using the sandbox code. To do this, just run "pear upgrade --force package.xml" from your code sandbox and pointing at your package.xml file (it can sometimes be package2.xml). This will install your current development package code into your PEAR installation. Then, when you run "pear run-tests -r" from your sandbox's /tests subdirectory, the tests are found in your sandbox and executed based on your include_path, which most likely points to your PEAR installation rather than your sandbox. If you do install your sandbox code, *and* your package is one that installs its tests too (you should see steps in package.xml that include your test files), then you can run the tests that are installed with the package in the PEAR installation. Do this with "pear run-tests -p MyPackage". A final alternative, which is actually the one I prefer, is to wrap the PHPT suite using PHPUnit. You can do this with an AllTests.php. PHPUnit has the capability to find and run PHPTs. Take a look at the AllTests.php file that I use in the XML_Util package. The only code changes necessary to adapt it to your package will be s/XML_Util/Your_Package/g (for paths and object names) and s/XML_UTIL/YOUR_PACKAGE/g (for constants). To run this from for an installed package, use "pear run-tests -up MyPackage". The best argument I think for the AllTests wrapper is PHPUnit's code coverage generation... -- CRB

« previous php.pear.dev (#52896) next »