Author: bernhard Date: Wed Jan 11 09:54:35 2006 New Revision: 11094 Removed: trunk/src/dynoplibs/alarm.pasm trunk/src/dynoplibs/alarm2.pasm trunk/src/dynoplibs/dan.pasm Modified: trunk/MANIFEST trunk/MANIFEST.SKIP trunk/src/dynoplibs/README trunk/t/dynoplibs/ (props changed) trunk/t/dynoplibs/dan.t trunk/t/dynoplibs/myops.t Log: dynops: Put remaining examples from src/dynoplibs/*.pasm into t/dynoplibs/*.t
Modified: trunk/MANIFEST ============================================================================== --- trunk/MANIFEST (original) +++ trunk/MANIFEST Wed Jan 11 09:54:35 2006 @@ -1696,10 +1696,7 @@ src/dynclasses/quantumreg.pmc src/dynclasses/subproxy.pmc [devel] src/dynext.c [] src/dynoplibs/README [devel] -src/dynoplibs/alarm.pasm [devel] -src/dynoplibs/alarm2.pasm [devel] src/dynoplibs/dan.ops [devel] -src/dynoplibs/dan.pasm [devel] src/dynoplibs/myops.ops [devel] src/embed.c [] src/encoding.c [] Modified: trunk/MANIFEST.SKIP ============================================================================== --- trunk/MANIFEST.SKIP (original) +++ trunk/MANIFEST.SKIP Wed Jan 11 09:54:35 2006 @@ -1,5 +1,5 @@ # $Id$ -# generated by tools/dev/gen_manifest_skip.pl Wed Jan 11 17:40:25 2006 +# generated by tools/dev/gen_manifest_skip.pl Wed Jan 11 18:49:55 2006 # # This file should contain a transcript of the svn:ignore properties # of the directories in the Parrot subversion repository. (Needed for @@ -1040,6 +1040,8 @@ ^t/dynclass/.*\.pir$ ^t/dynclass/.*\.pir/ # generated from svn:ignore of 't/dynoplibs/' +^t/dynoplibs/.*\.pasm$ +^t/dynoplibs/.*\.pasm/ ^t/dynoplibs/.*\.pir$ ^t/dynoplibs/.*\.pir/ # generated from svn:ignore of 't/examples/' Modified: trunk/src/dynoplibs/README ============================================================================== --- trunk/src/dynoplibs/README (original) +++ trunk/src/dynoplibs/README Wed Jan 11 09:54:35 2006 @@ -1,3 +1,5 @@ +# $Id$ + This directory is intended for building dynamic opcode libs. 1) edit/create your foo.ops source (s. myops.ops) @@ -7,4 +9,6 @@ This directory is intended for building $ export LD_LIBRARY_PATH=.:blib/lib $ make -s $ make shared -$ make -C dynoplibs +$ make dynoplibs + +For tests and thus examples see t/dynoplibs/*.t. Modified: trunk/t/dynoplibs/dan.t ============================================================================== --- trunk/t/dynoplibs/dan.t (original) +++ trunk/t/dynoplibs/dan.t Wed Jan 11 09:54:35 2006 @@ -6,7 +6,7 @@ use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 6; +use Parrot::Test tests => 7; use Parrot::Config; @@ -95,3 +95,13 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "m CODE 42 OUTPUT + +pasm_output_is(<< 'CODE', << 'OUTPUT', "mul pasm syntax"); + loadlib P0, "dan_ops" + mul I0, 3, 3.9 + print I0 + print "\n" + end +CODE +11 +OUTPUT Modified: trunk/t/dynoplibs/myops.t ============================================================================== --- trunk/t/dynoplibs/myops.t (original) +++ trunk/t/dynoplibs/myops.t Wed Jan 11 09:54:35 2006 @@ -6,7 +6,7 @@ use strict; use warnings; use lib qw( . lib ../lib ../../lib ); use Test::More; -use Parrot::Test tests => 3; +use Parrot::Test tests => 5; use Parrot::Config; @@ -56,3 +56,82 @@ pir_output_is(<< 'CODE', << 'OUTPUT', "w CODE fortytwo OUTPUT + + +pir_output_is(<< 'CODE', << 'OUTPUT', "one alarm"); + +.sub main :main + P1 = loadlib "myops_ops" + find_global P0, "_alarm" + alarm 2.0, P0 + set I0, 1 +loop: + sleep 1 + print I0 + print "\n" + inc I0 + # check_events + le I0, 3, loop + print "done.\n" +.end + +.sub _alarm + print "alarm\n" +.end +CODE +1 +alarm +2 +3 +done. +OUTPUT + +pir_output_is(<< 'CODE', << 'OUTPUT', "three alarm"); + +.sub main :main + P1 = loadlib "myops_ops" + find_global P0, "_alarm3" + alarm 3.3, 0.4, P0 + find_global P0, "_alarm2" + alarm 2.2, P0 + find_global P0, "_alarm1" + alarm 1.5, 2.0, P0 + set I0, 1 +loop: + sleep 1 + print I0 + print "\n" + inc I0 + # check_events + le I0, 5, loop + print "done.\n" +.end + +.sub _alarm1 + print "alarm1\n" +.end + +.sub _alarm2 + print "alarm2\n" +.end + +.sub _alarm3 + print "alarm3\n" +.end + +CODE +1 +alarm1 +2 +alarm2 +3 +alarm3 +alarm1 +alarm3 +4 +alarm3 +alarm3 +alarm3 +5 +done. +OUTPUT
