29 | | my $template_top = << 'END_CODE'; |
30 | | .sub _main |
31 | | |
32 | | load_bytecode 'runtime/parrot/include/parrotlib.pbc' |
33 | | .local pmc location_sub |
34 | | .local string location |
35 | | END_CODE |
36 | | |
37 | | my $template_bottom = << 'END_CODE'; |
38 | | print location |
39 | | print "\n" |
40 | | |
41 | | end |
| 22 | .sub main :main |
| 23 | load_bytecode 'runtime/parrot/include/parrotlib.pbc' |
| 24 | |
| 25 | .include 'test_more.pir' |
| 26 | plan(6) |
| 27 | |
| 28 | test_include_file_location() |
| 29 | test_include_file_location_non_existent() |
| 30 | test_imcc_compile_file_location() |
| 31 | test_imcc_compile_file_location_non_existent() |
| 32 | test_dynext_location() |
| 33 | test_dynext_location_non_existent() |
56 | | pir_output_is( << "END_CODE", << 'END_OUT', 'include_file_location, non-existent' ); |
57 | | $template_top |
58 | | location_sub = get_global ['_parrotlib'], "include_file_location" |
59 | | location = location_sub( 'nonexistent.pasm' ) |
60 | | $template_bottom |
61 | | END_CODE |
| 39 | .sub test_include_file_location |
| 40 | .local pmc location_sub |
| 41 | .local string location |
| 42 | location_sub = get_global ["_parrotlib"], "include_file_location" |
| 43 | location = location_sub( 'datatypes.pasm' ) |
| 44 | is(location,'runtime/parrot/include/datatypes.pasm', 'include file location' ) |
| 45 | .end |
67 | | pir_output_is( << "END_CODE", << 'END_OUT', 'imcc_compile_file_location' ); |
68 | | $template_top |
69 | | location_sub = get_global ['_parrotlib'], "imcc_compile_file_location" |
70 | | location = location_sub( 'parrotlib.pbc' ) |
71 | | $template_bottom |
72 | | END_CODE |
73 | | runtime/parrot/include/parrotlib.pbc |
74 | | END_OUT |
75 | | |
76 | | pir_output_is( << "END_CODE", << 'END_OUT', 'imcc_compile_file_location, non-existent' ); |
77 | | $template_top |
78 | | location_sub = get_global ['_parrotlib'], "imcc_compile_file_location" |
79 | | location = location_sub( 'nonexistent.pbc' ) |
80 | | $template_bottom |
81 | | END_CODE |
| 57 | .sub test_imcc_compile_file_location |
| 58 | .local pmc location_sub |
| 59 | .local string location |
| 60 | location_sub = get_global ['_parrotlib'], "imcc_compile_file_location" |
| 61 | location = location_sub( 'parrotlib.pbc' ) |
| 62 | is(location, 'runtime/parrot/include/parrotlib.pbc','imcc compile file location') |
| 63 | .end |
87 | | pir_output_is( << "END_CODE", << "END_OUT", 'dynext_location' ); |
88 | | $template_top |
89 | | location_sub = get_global ['_parrotlib'], "dynext_location" |
90 | | location = location_sub( 'libnci_test', '$PConfig{load_ext}' ) |
91 | | $template_bottom |
92 | | END_CODE |
93 | | runtime/parrot/dynext/libnci_test$PConfig{load_ext} |
94 | | END_OUT |
95 | | |
96 | | pir_output_is( << "END_CODE", << 'END_OUT', 'dynext_location, non-existent' ); |
97 | | $template_top |
98 | | location_sub = get_global ['_parrotlib'], "imcc_compile_file_location" |
99 | | location = location_sub( 'nonexistent' ) |
100 | | $template_bottom |
101 | | END_CODE |
| 75 | .sub test_dynext_location |
| 76 | .include 'iglobals.pasm' |
| 77 | .local pmc config_hash, interp |
| 78 | .local pmc location_sub |
| 79 | .local string location |
| 80 | |
| 81 | interp = getinterp |
| 82 | config_hash = interp[.IGLOBALS_CONFIG_HASH] |
| 83 | $S0 = config_hash['load_ext'] |
| 84 | location_sub = get_global ['_parrotlib'], "dynext_location" |
| 85 | location = location_sub( 'libnci_test', $S0 ) |
| 86 | $S1 = 'runtime/parrot/dynext/libnci_test' |
| 87 | $S1 .= $S0 |
| 88 | is(location, $S1, 'dynext_location') |
| 89 | .end |