Re: pear run-tests phpUnit question
| From: | Helgi Þormar Þorbjörnsson | Date: | Fri, 18 Jan 2008 17:23:12 +0000 |
| Subject: | Re: pear run-tests phpUnit question | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-48957@lists.php.net to get a copy of this message | ||
On Jan 18, 2008 3:53 PM, Chuck Burgess <demon.gene@gmail.com> wrote:
> On Jan 18, 2008 9:22 AM, till <klimpong@gmail.com> wrote:
>
> > Hi list,
> >
> > I've been trying to run the tests for Console_GetoptPlus today and I
> > couldn't figure out at first why "pear run-tests ..." didn't do
> anything.
> > Now Chuck told me to add the "-up" argument to "pear run-tests ..." to
> make
> > it use phpunit and so on and this all got me/us curious if it would be
> > useful if package listed phpUnit as an optional dependency in
> package.xmlwhen they make use of it. I'm also curious if my PEAR (
> > 1.7.0RC1) is broken because it did not add this by itself, or if the
> tests
> > a broken or if it's supposed supposed to be like that.
>
Start by upgrading to RC2
>
> > Of course running tests is not a die-hard requirement for many but I was
> > trying to come up with a solution how we could use the existing
> > format of package.xml to make it do what I want. ;-)
> >
> > Just food for thoughts.
> >
> > Regards,
> > Till
> >
>
> My thoughts on the matter were more towards ensuring that if you choose to
> run "pear run-tests" on a package you have installed, that the PEAR
> installer should be capable of confirming you have the necessary testing
> framework installed and that it is a version of the framework that the
> packager knows can run the tests. There have been so many updates to
> PhpUnit in the last year that I currently know that some of my tests in
> PhpDocumentor that worked in PhpUnit 3.1.x no longer work in 3.2.x.
>
> I was thinking that if package.xml contained an optional test harness
> dependency, separate from regular "package" dependencies, that the *
> run-tests* logic could perform some helpful validations of something like
> "this package expects phpunit 3.0.3 up to 3.1.9 only" and can output a
> useful message if the user has say phpunit 4.1 installed. Otherwise,
> "good"
> tests could fail or warnings/errors could occur which crash the whole test
> suite. This seems to me to be analogous to controlling the min/max PHP
> version the package can run on, which package.xml already can do... this
> new
> dependency would control which test harness and versions the package's
> tests
> were expected to run/succeed on.
>
> If this kind of intelligence was built into the pear command along with
> package.xml, then later on I could see the installer potentially having
> additional logic to choose the -u arg without you having to specify it on
> the command line, but to me that is a minor concern.
Seems a bit complicated unless the package supplies the min / max stuff for
phpunit them self via package.xml
Perhaps we'd be putting too much logic into the test runner (well the
command part), what do you think Greg, viable ?
- Helgi