Parrot::Test::Harness - a test harness for languages built on Parrot
Tell the harness which language, and optionally compiler or other executable, you want to use in a file called t/harness:
use Parrot::Test::Harness language => 'punie'; # or use Parrot::Test::Harness language => 'perl6', compiler => 'perl6.pbc'; # or use Parrot::Test::Harness language => 'perl6', compiler => 'perl6.pbc'; # or use Parrot::Test::Harness language => 'eclectus', exec => [ 'petite', '--script' ], files => [ 't/*.pl' ];
That's it. Seriously.
This module provides a basic test harness for Parrot-hosted languages. Right now it parameterizes the three parameters that at least four language implementations need.
If you really want, you can pass a third option to the use line. arguments should be an array reference containing additional arguments (as you might find on the command line).
use
arguments
If you don't pass a compiler or exec argument pair, the harness will run the tests with perl. If you do pass one of these pairs, the harness can use another executable. For exec a reference to a an array of string is expected. For compiler the harness will run the tests with parrot, calling the compiler file as the first argument.
compiler
exec
perl
parrot
This means that you can write your tests in your language itself and run them through your compiler itself. If you can load PIR libraries from your language, you can even use the existing PIR testing tools.
Written by chromatic with most of the intelligence stolen from the Punie harness and most of that probably stolen from Test::Harness
Please send patches and bug reports via Parrot's RT queue or to the mailing list.
The option '--files' is used for supporting unified testing of language implementations. It is used by languages/t/harness for collecting a list testfiles from many language implementations.
When that option is passed, a list of pathes to test files is printed. Currently these test files need to Perl 5 scripts. The file pathes are relative to a language implementation dir.
When there is no '--files' option, then things are saner. Nothing is printed. An array of file pathes is returned to the caller.
To install Parrot::Op, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::Op
CPAN shell
perl -MCPAN -e shell install Parrot::Op
For more information on module installation, please visit the detailed CPAN module installation guide.