Amir Karger schrieb:

I have a test script that runs 85 tests (and will run many more once I
write more opcodes. Luckily, I developed it already when I was doing
plotz). I could easily modify it to output "ok n" and "not ok" with a
comment about what went wrong.  However, because it's a big Z-code
file, it would be hard to write a Test::Simple script that calls ok()
85 times. In quickly looking at languages/* I saw that there seem to
be a number of different ways of doing tests, some of which use
Parrot::Test.

So if all I want to do is, essentially, perl -e 'chdir languages/Z and
system("parrot z3.imc t/test.z3")' and let the script print out a
bunch of (not )?ok's for Test::Harness to read, what should I do in my
t directory?

AFAIK there are no strict testing requirements for language implementations.
I think that the most important thing is to try to be nice.

There are three things that I want to suggest:

i. Z/t/z3.t should be a Perl5 script that prints output in Test Anything Protcol.
So put your 'system("parrot z3.imc t/test.z3")' into Z/t/z3.t

ii. Z/t/harness should behave like most other 't/harness'. It executes the t/*.t files and prints
a harness report of the output.

iii. 'Z/t/harness --files' returns the list of test files.

You could also try to put 'Z' into @unified_testable_languages of 'languages/testall' and add support for Z in 'config/gen/makefiles/languages.in'. Calling 'make languages-test' could then test 'Z' along the other languages.

(Also, how do I make sure it'll find parrot before make
install has been done?)
I would expect that an install parrot is only found when the
executable 'parrot' is in $PATH.
Before installation I usually use $FindBin::Bin for building up the
relevant paths.

I didn't see a languages.pod with this info,
but maybe I just wasn't looking in the right place.
I think there in no such documentation. New insight could be added to 'docs/compiler_faq.pod'.

CU, Bernhard

Reply via email to