1 # Copyright (C) 2009, Jonathan "Duke" Leto <jonathan@leto.net>
3 .namespace [ 'Tapir'; 'Stream' ]
5 # 06:28:33 <@chromatic> :load executes only when loading from bytecode.
6 # 06:28:48 <@chromatic> :init executes right after compilation.
7 # 06:29:17 <@chromatic> The effects of :init should be frozen into PBC.
8 # 06:37:26 <@chromatic> :anon :init trips the "Do something special with bytecode" magic.
10 .sub _initialize :load :anon
13 klass = newclass [ 'Tapir'; 'Stream' ]
14 klass.'add_attribute'('ordered')
15 klass.'add_attribute'('pass')
16 klass.'add_attribute'('fail')
17 klass.'add_attribute'('skip')
18 klass.'add_attribute'('todo')
19 klass.'add_attribute'('plan')
20 klass.'add_attribute'('exit_code')
25 fail = getattribute self, "fail"
29 exit_code = self."get_exit_code"()
30 if exit_code goto failz
32 .local pmc skip, pass, todo, plan, ordered
33 ordered = self."get_ordered"()
34 unless ordered goto disorder
36 skip = self."get_skip"()
37 pass = self."get_pass"()
38 todo = self."get_todo"()
39 plan = self."get_plan"()
50 .sub set_exit_code :method
52 setattribute self, "exit_code", exit_code
55 .sub set_ordered :method
57 setattribute self, "ordered", ordered
62 setattribute self, "pass", pass
67 setattribute self, "fail", fail
72 setattribute self, "todo", todo
77 setattribute self, "skip", skip
82 setattribute self, "plan", plan
85 .sub get_exit_code :method
87 exit_code = getattribute self, "exit_code"
91 .sub get_ordered :method
93 ordered = getattribute self, "ordered"
99 pass = getattribute self, "pass"
103 .sub get_fail :method
105 fail = getattribute self, "fail"
109 .sub get_todo :method
111 todo = getattribute self, "todo"
115 .sub get_skip :method
117 skip = getattribute self, "skip"
121 .sub get_plan :method
123 plan = getattribute self, "plan"
128 .local pmc skip, pass, fail, todo
129 skip = getattribute self, "skip"
130 pass = getattribute self, "pass"
131 fail = getattribute self, "fail"
132 todo = getattribute self, "todo"
144 # vim: expandtab shiftwidth=4 ft=pir: