diff --git a/.gitignore b/.gitignore index 4b604ca..24e9ed4 100644 --- a/.gitignore +++ b/.gitignore @@ -17,23 +17,22 @@ wmlscript/opcode.pir wmlscript/stdlibs.pir wmlscript/library/*.pbc +dynext/*.dll +dynext/*.so + dynext/ops/*.bundle dynext/ops/*.c -dynext/ops/*.dll dynext/ops/*.h dynext/ops/*.o dynext/ops/*.obj -dynext/ops/*.so dynext/pmc/*.bundle dynext/pmc/*.c -dynext/pmc/*.dll dynext/pmc/*.dump dynext/pmc/*.h dynext/pmc/*.o dynext/pmc/*.obj dynext/pmc/*.pdb -dynext/pmc/*.so t/*.out t/*.pbc diff --git a/Makefile.in b/Makefile.in index 881af70..a21135b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -151,6 +151,9 @@ help: test: all $(PERL) t/harness +pmctest: all + prove --exec=$(PARROT) t/pmc//*.t + codetest: codetest-c codetest-make codetest-perl codetest-pir codetest-pod T_C := dynext//pmc//*.pmc dynext//ops//*.ops diff --git a/t/pmc/boolean_hll.t b/t/pmc/boolean_hll.t index 19c397d..089a520 100644 --- a/t/pmc/boolean_hll.t +++ b/t/pmc/boolean_hll.t @@ -39,30 +39,33 @@ Tests C PMC .end .sub 'check_istrue' - .const 'WmlsBoolean' K = '1' - $S0 = K + $P1 = new 'WmlsBoolean' + set $P1, 1 + $S0 = $P1 is($S0, 'true', "check istrue") - $P0 = istrue K + $P0 = istrue $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') .end .sub 'check_typeof' - .const 'WmlsBoolean' K = '1' - $S0 = K + $P1 = new 'WmlsBoolean' + set $P1, 1 + $S0 = $P1 is($S0, 'true', "check typeof") - $P0 = typeof K + $P0 = typeof $P1 $I0 = $P0 is($I0, 3) isa_ok($P0, 'WmlsInteger') .end .sub 'check_defined' - .const 'WmlsBoolean' K = '1' - $S0 = K + $P1 = new 'WmlsBoolean' + set $P1, 1 + $S0 = $P1 is($S0, 'true', "check defined") - $P0 = defined K + $P0 = defined $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') diff --git a/t/pmc/float_hll.t b/t/pmc/float_hll.t index 11d68fd..ccb59f1 100644 --- a/t/pmc/float_hll.t +++ b/t/pmc/float_hll.t @@ -22,10 +22,9 @@ Tests C PMC .sub 'main' :main .include 'test_more.pir' - plan(15) + plan(13) check_HLL() - check_HLL_const() check_istrue() check_typeof() check_defined() @@ -40,38 +39,34 @@ Tests C PMC isa_ok($P0, 'WmlsFloat') .end -.sub 'check_HLL_const' - .const 'WmlsFloat' K = '3.14' - $N0 = K - is($N0, 3.14, "check HLL & .const") - isa_ok(K, 'WmlsFloat') -.end - .sub 'check_istrue' - .const 'WmlsFloat' K = '3.14' - $N0 = K + $P1 = new 'WmlsFloat' + set $P1, 3.14 + $N0 = $P1 is($N0, 3.14, "check istrue") - $P0 = istrue K + $P0 = istrue $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') .end .sub 'check_typeof' - .const 'WmlsFloat' K = '3.14' - $N0 = K + $P1 = new 'WmlsFloat' + set $P1, 3.14 + $N0 = $P1 is($N0, 3.14, "check typeof") - $P0 = typeof K + $P0 = typeof $P1 $I0 = $P0 is($I0, 1) isa_ok($P0, 'WmlsInteger') .end .sub 'check_defined' - .const 'WmlsFloat' K = '3.14' - $N0 = K + $P1 = new 'WmlsFloat' + set $P1, 3.14 + $N0 = $P1 is($N0, 3.14, "check defined") - $P0 = defined K + $P0 = defined $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') diff --git a/t/pmc/integer_hll.t b/t/pmc/integer_hll.t index 730aec4..fd2a400 100644 --- a/t/pmc/integer_hll.t +++ b/t/pmc/integer_hll.t @@ -22,10 +22,9 @@ Tests C PMC .sub 'main' :main .include 'test_more.pir' - plan(15) + plan(13) check_HLL() - check_HLL_const() check_istrue() check_typeof() check_defined() @@ -40,38 +39,34 @@ Tests C PMC isa_ok($P0, 'WmlsInteger') .end -.sub 'check_HLL_const' - .const 'WmlsInteger' K = '42' - $I0 = K - is($I0, 42, "check HLL & .const") - isa_ok(K, 'WmlsInteger') -.end - .sub 'check_istrue' - .const 'WmlsInteger' K = '42' - $I0 = K + $P1 = new 'WmlsInteger' + set $P1, 42 + $I0 = $P1 is($I0, 42, "check istrue") - $P0 = istrue K + $P0 = istrue $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') .end .sub 'check_typeof' - .const 'WmlsInteger' K = '42' - $I0 = K + $P1 = new 'WmlsInteger' + set $P1, 42 + $I0 = $P1 is($I0, 42, "check typeof") - $P0 = typeof K + $P0 = typeof $P1 $I0 = $P0 is($I0, 0) isa_ok($P0, 'WmlsInteger') .end .sub 'check_defined' - .const 'WmlsInteger' K = '42' - $I0 = K + $P1 = new 'WmlsInteger' + set $P1, 42 + $I0 = $P1 is($I0, 42, "check defined") - $P0 = defined K + $P0 = defined $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') diff --git a/t/pmc/string_hll.t b/t/pmc/string_hll.t index d797cd6..81c5059 100644 --- a/t/pmc/string_hll.t +++ b/t/pmc/string_hll.t @@ -22,11 +22,9 @@ Tests C PMC .sub 'main' :main .include 'test_more.pir' - plan(17) + plan(13) check_HLL() - check_HLL_const() - check_empty_string() check_istrue() check_typeof() check_defined() @@ -41,45 +39,34 @@ Tests C PMC isa_ok($P0, 'WmlsString') .end -.sub 'check_HLL_const' - .const 'WmlsString' K = "simple string" - $S0 = K - is($S0, "simple string", "check HLL & .const") - isa_ok(K, 'WmlsString') -.end - -.sub 'check_empty_string' - .const 'WmlsString' K = '' - $S0 = K - is($S0, '', "check empty string") - isa_ok(K, 'WmlsString') -.end - .sub 'check_istrue' - .const 'WmlsString' K = "simple string" - $S0 = K + $P1 = new 'WmlsString' + set $P1, "simple string" + $S0 = $P1 is($S0, "simple string", "check istrue") - $P0 = istrue K + $P0 = istrue $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean') .end .sub 'check_typeof' - .const 'WmlsString' K = "simple string" - $S0 = K + $P1 = new 'WmlsString' + set $P1, "simple string" + $S0 = $P1 is($S0, "simple string", "check typeof") - $P0 = typeof K + $P0 = typeof $P1 $I0 = $P0 is($I0, 2) isa_ok($P0, 'WmlsInteger') .end .sub 'check_defined' - .const 'WmlsString' K = "simple string" - $S0 = K + $P1 = new 'WmlsString' + set $P1, "simple string" + $S0 = $P1 is($S0, "simple string", "check defined") - $P0 = defined K + $P0 = defined $P1 $S0 = $P0 is($S0, 'true') isa_ok($P0, 'WmlsBoolean')