Skip to content

Commit

Permalink
Added first test to oztest
Browse files Browse the repository at this point in the history
  • Loading branch information
johanberntsson committed May 28, 2018
1 parent 36b8ea2 commit f0a9763
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 39 deletions.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ X64 := /usr/bin/x64 -warp -autostart-delay-random
#all: czechz3
#all: czechz5
#all: strictz3
all: strictz5
#all: strictz5
#all: etude
#all: praxix
all: oztestz3

d64.czechz3:
acme -DZ3=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
Expand All @@ -34,6 +35,16 @@ d64.praxix:
cp test/praxix.d64 praxix.d64
$(C1541) -attach praxix.d64 -write ozmoo ozmoo

d64.oztestz5:
acme -DZ5=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
cp test/oztestz5.d64 oztest.d64
$(C1541) -attach oztest.d64 -write ozmoo ozmoo

d64.oztestz3:
acme -DZ3=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
cp test/oztestz3.d64 oztest.d64
$(C1541) -attach oztest.d64 -write ozmoo ozmoo

d64.strictz3:
acme -DZ3=1 $(DEBUGFLAGS) $(VMFLAGS) --cpu 6510 --format cbm -l acme_labels.txt --outfile ozmoo ozmoo.asm
cp test/strictz3.d64 strictz3.d64
Expand Down Expand Up @@ -74,6 +85,12 @@ etude: d64.etude
praxix: d64.praxix
$(X64) praxix.d64

oztestz3: d64.oztestz3
$(X64) oztest.d64

oztestz5: d64.oztestz5
$(X64) oztest.d64

strictz3: d64.strictz3
$(X64) strictz3.d64

Expand Down
8 changes: 4 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ all: make_praxix

make_oztest:
inform -v3 oztest/oztest.inf oztest.z3
../create_d64.rb oztest.z3 oztestz3.d64
inform -v5 oztest/oztest.inf oztest.z5
../create_d64.rb oztest.z5 oztest.d64
../create_d64.rb oztest.z3 oztest.d64
../create_d64.rb oztest.z5 oztestz5.d64

make_czech:
inform -v3 czech/czech.inf czech.z3
../create_d64.rb czech.z3 czechz3.d64
inform -v5 czech/czech.inf czech.z5
../create_d64.rb czech.z5 czechz5.d64
../create_d64.rb czech.z3 czechz3.d64

make_strictz:
inform -v3 strictz/strictz.inf strictz.z3
inform -v5 strictz/strictz.inf strictz.z5
../create_d64.rb strictz.z3 strictz3.d64
inform -v5 strictz/strictz.inf strictz.z5
../create_d64.rb strictz.z5 strictz5.d64

make_etude:
Expand Down
57 changes: 23 additions & 34 deletions test/oztest/oztest.inf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Switches e;

Constant TEST_VERSION "0.1";

!!
!! USAGE NOTES:
!!
Expand Down Expand Up @@ -921,7 +920,7 @@ Property propa 11;
Property propb 12;
Property propc 13;
Property propd 14;
Property prope 15;
!Property prope 15;

Object Obj1 "Test Object #1"
has attr1 attr2
Expand Down Expand Up @@ -1617,42 +1616,33 @@ Object Obj6 "test of an object with a shortname which is about as long as they g
! MAIN calls a bunch of subs. Each one runs a set of related tests.
!---------------------- MAIN

Property prop8 7;
Property prop10 10;
Object RockRoom "Rock Room"
with prop10 77;
Object Compass "compass";
Object -> SouthWall "south wall"
with prop8 prop10;

[ test_dejavu a b;
print "Dejavu ";
a = RockRoom;
Gtemp = SouthWall;
@get_prop Gtemp prop8 -> sp;
@get_prop a sp -> b;
assert0(b, 77);
];


[ Main;
Testnum = 0; Passed = 0; Failed = 0; Print_Tests = 0;
@print "OZTEST: the Comprehensive Z-machine Emulation CHecker, version ";
! It's not entirely cool to be using print_paddr before testing.
! So sue me.
@print "OZTEST, version ";
@print_paddr TEST_VERSION;
@print "^Test numbers appear in [brackets].^";

pt();
@print "^print works or you wouldn't be seeing this.^^";

! Standard = 0->50;
! if(0->50 || 0->51)
! print "Standard ", 0->50, ".", 0->51, " "; 0;
! print "interpreter ", 0->30, (char) 0->31;

! If jumps don't work, we just give up.

! Now test sets of functionality.
! Argument of 1 means SKIP tests, 0 means DON'T skip the tests
! Note that there may be stack ops,e.g., in the arithmetic test, and
! those won't get skipped just because you call test_stack with '1'.
! MOST tests in earlier subs won't
! depend on functionality tested in later subs, but simple
! jump, stack, call, print functionality is needed for almost all tests.
test_jumps(0); @print "^";
test_variables(0); @print "^";
test_arithmetic(0); @print "^";
test_logical(0); @print "^";
test_memory(0); @print "^";
test_subroutines(0); @print "^";
test_objects(0); @print "^";
test_indirect(0); @print "^";
test_misc(0); @print "^";
test_header(0); @print "^";
test_print(0); @print "^";
test_dejavu(); @print "^";


print "^^Performed ", Testnum, " tests.^";
print "Passed: ", Passed, ", Failed: ", Failed;
print ", Print tests: ", Print_Tests, "^";
Expand All @@ -1661,7 +1651,6 @@ Object Obj6 "test of an object with a shortname which is about as long as they g
@print " passed + failed + print tests!^^";
}
print "Didn't crash: hooray!^";
read mytable 0;
print "Last test: quit! (press any key)^";
read mytable 0;
@quit;
Expand Down
Binary file renamed test/oztest.d64 → test/oztestz3.d64
Binary file not shown.
Binary file added test/oztestz5.d64
Binary file not shown.

0 comments on commit f0a9763

Please sign in to comment.