Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Bernhard (4508)

https://www.xing ... hard_Schmalhofer

A freelance software engineer with experience in webapplications, databases and bioinformatics.

A contributor to Parrot and the person behind Pipp.

A physicist who worked with third sound in Helium-III and CCD X-ray detectors.

barney on
github: []
LinkedIn: []
XING: []

Journal of Bernhard (4508)

Thursday November 27, 2008
03:36 PM

Rewriting Pipp tests in PHP

[ #37961 ]

Pipp is Parrot's PHP and it has small test suite that lives alongside the code in the Parrot repository. Most of the test scripts are written in Perl 5 using the Parrot::Test modules. So usually I tell Pipp to run some PHP code and check whether the expected result is printed. This works fine but is not very exiting.

More exciting, for some definition of exciting, is to run PHP scripts and emit TAP with a testing lib implemented in PHP. So Pipp this needs

  1. user defined functions with param passing
  2. global for keeping track of the running test count
  3. module loading

Stealing from Rakudo I now got most of that. global is still missing, so currently I pass in the current test number and increment it outside the testing functions.

Over the next days I plan to port a selection of the easier scripts to PHP. Things like TODO, SKIP and regex matching have to wait for later. Takers welcome!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Can TAP library be written in Perl 6? AFAIR, it was one of goals of Parrot: to be possible to use libraries in one language from another.
    • Right now I know of no example where libraries are written in another high level language. But it is definitly the plan to make this possible.
      Implementing the testing library in PHP is of course also driving the development of Pipp. For example I got reminded that Pipp had no support for parameters of user defined functions.
      /* */
    • Pheme has used the PIR Test::More for a couple of years. All of Pheme's tests are written in Pheme.