2 # Copyright (C) 2009, Parrot Foundation.
5 # Common functions for various Packfile* PMCs tests.
7 # Currently parrot doesn't support system independent PBCs. So, cross your
8 # fingers and try different filename for binary-dependent tests...
11 .local string filename
12 filename = 't/pmc/testlib/number.pbc'
16 # common pbc loading function
19 .include "interpinfo.pasm"
23 pio = new ['FileHandle']
31 .sub '_find_segment_by_type'
36 pfdir = pf.'get_directory'()
49 .sub '_find_segment_by_prefix'
54 pfdir = pf.'get_directory'()
59 $I0 = index $S0, prefix
67 .sub '_get_fixup_table'
70 .tailcall '_find_segment_by_type'(pf, "PackfileFixupTable")
74 # Report no ok for loading packfile failures
75 .sub report_load_error
78 .local string msg, aux
79 msg = concat desc, ' - error loading packfile: '
80 aux = except['message']
90 # vim: expandtab shiftwidth=4 ft=pir: