Multiple Unit Test formats in PEAR, a solution?
| From: | Davey Shafik | Date: | Mon, 10 Oct 2005 02:19:04 +0000 |
| Subject: | Multiple Unit Test formats in PEAR, a solution? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-40117@lists.php.net to get a copy of this message | ||
Hey PEARs,
I would like to run an idea up the flagpole that I just had :)
It seems that there is no mandated test format in PEAR, and there are two main camps, PHPUnit (fitting as PHPUnit(2) is in PEAR) and .phpt (which work with pear run-tests). There is also SimpleTest, which I know some people use.
I think it would be great to add a <tester> tag to the new package2.xml, which would be a script to run the tests, effectively a replacement for "runTests.php".
Of course, if the <tester> tag exists, the command "pear run-tests $package" should issue a warning stating that it is not using the built in tester and could be malicious code. With a Y/n option to continue.
Furthermore, if the tag is not there, then it simply uses the current tester.
Of course, this means you will need to put an (optional) dependency of PHPUnit(2) or SimpleTest (if its in a channel somewhere, or can we depend on packages at a specific url? It does have a PEAR package available...)
Finally, I think that if tests exist, PEAR should say something on install:
install ok: $package
Unit tests exist for this package, run them using: pear run-tests $package
Thoughts? I think that if we did this, the quality of PEAR would increase exponentially :)
- Davey