[z-machine] Partial Z-machine test program available

Amir Karger amirkargerweb@yahoo.com
Wed, 1 Oct 2003 20:50:57 -0700 (PDT)


I'd mentioned I was working on a comprehensive test of the Z-machine.
I'm sure I'll never get there, but I've got a first draft of a small
piece of it developed enough that I think it's ready for the mailing
list to make fun of. If it ever gets more comprehensive, I'll upload it
to ifarchive, but for now it's at the much less glamorous:

http://home.comcast.net/~amirkarger/download/t7.inf
(the test program)
http://home.comcast.net/~amirkarger/download/t7.z5
(t7.inf compiled with Inform 6.21)
http://home.comcast.net/~amirkarger/download/t7.out
(output from `frotz t7.z5`)

The script tests one set of functionality (jumps, subroutines,
arithmetic, etc.) at a time, and a given set can be skipped. It counts
passed and failed tests, and separates out printing tests, which you
need to confirm (by eye or with diff) printed out correctly. Tests that
fail try to give some info about how it failed, but it's still pretty
rudimentary. (Partly because I've been trying to write the program to
not require the "(string)" command in the assert routines, because that
loads in a bunch of code that an in-development interpreter might not
handle yet.)

The program is based on Evin Robertson's test.inf, which is distributed
with nitfol. It tests about 50 opcodes with 180+ tests. Which just
happen to be the opcodes I currently support in my Z-machine to Perl
translation program. It's likely that in coming weeks, I'll add tests
to support the object/property opcodes (They're next on my list to
implement.) and a few others. It's unlikely that I'll get v6 stuff, or
even fancy v5 stuff (catch/throw? I/O?) done any time soon, since
there's other projects waiting in the wings.  And things like read,
restore may be tough to test. Still, there's an awful lot to test with
just 75 opcodes.

I hope that at some point during my coding, I'll get the energy to add
in lots more tests - testing var/short/long forms of opcodes,
aggressively testing negative numbers and lots of other stuff, maybe
even incorporating zstrict - but I may never get to it. As such, I'd
definitely appreciate any additions to the program. (The program has
some notes in it describing how to add tests.) I'd also appreciate
anyone pointing out that my tests are incorrect. Currently, frotz
passes all tests, dzip/jzip and rezrov get some negative number stuff
wrong (?).

Happy testing!

-Amir

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com