I'm currently trying to implement [#40064: [TODO] shootout example testing].
Because the PIR shootout scripts are run with specific options, I must be
able
to run the script with these options that I can get by parsing the she-bang
line.
But by looking in other tests and in the Parrot::Test, it seems that the
canonical way
of running a PIR script is through the example_output_is() function.
BUT this function does not take any arguments for Parrot.
By looking again in the code I figured out that maybe I could use the
TEST_PROG_ARGS env var
(if the script name does not match "opt").
But it is undocumented and not very robust, so What Should I do ?
Thanks,
Karl Forner
I'd subclass Parrot::Test and create a function shootout_output_is(), which
takes an extra commandline argument.
leo
Hmmm but if I subclass Parrot::Test, I won't be able to reuse any code. So
if by instance the multiplatform way of getting the path
to the parrot interpreter changes, I will have to synchronyze the code in
the subclass too. Isn't it evil ?
By the way, I have implemented the test using the TEST_PROG_ARGS environment
variable.
It is not very elegant but at least it seems to work for now.
There are already Test classes: see lib/Parrot/Test/*.pm. If there's anything
wrong with code reusablility, this should be fixed ;)
leo