2 # Copyright (C) 2001-2010, Parrot Foundation.
7 t/library/parrotlib.t - testing library/parrotlib.pir
11 % prove t/library/parrotlib.t
15 This test program test whether the library 'parrotlib.pir' returns the
16 expected absolute filenames.
20 # Common code in the test files
23 load_bytecode 'runtime/parrot/include/parrotlib.pbc'
25 .include 'test_more.pir'
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()
37 # Testing include_file_location
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' )
47 .sub test_include_file_location_non_existent
48 .local pmc location_sub
49 .local string location
50 location_sub = get_global ['_parrotlib'], "include_file_location"
51 location = location_sub( 'nonexistent.pasm' )
52 is(location, '', 'include file location non-existent')
55 # Testing imcc_compile_file_location
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')
65 .sub test_imcc_compile_file_location_non_existent
66 .local pmc location_sub
67 .local string location
68 location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
69 location = location_sub( 'nonexistent.pbc' )
70 is(location, '', 'imcc compile file location, non-existent')
73 # Testing dynext_location
75 .sub test_dynext_location
76 .include 'iglobals.pasm'
77 .local pmc config_hash, interp
78 .local pmc location_sub
79 .local string location
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'
88 is(location, $S1, 'dynext_location')
91 .sub test_dynext_location_non_existent
92 .local pmc location_sub
93 .local string location
94 location_sub = get_global ['_parrotlib'], "imcc_compile_file_location"
95 location = location_sub( 'nonexistent' )
96 is(location, '', 'dynext location non-existent')
101 Bernhard Schmalhofer <Bernhard.Schmalhofer@gmx.de>
105 F<runtime/parrot/library/parrotlib.pir>
113 # vim: expandtab shiftwidth=4 ft=pir: