fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / t / library / parrotlib.t
blob838b539ad79f04cffd87d7ca451a4a65659fec03
1 #!./parrot
2 # Copyright (C) 2001-2010, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/library/parrotlib.t - testing library/parrotlib.pir
9 =head1 SYNOPSIS
11         % prove t/library/parrotlib.t
13 =head1 DESCRIPTION
15 This test program test whether the library 'parrotlib.pir' returns the
16 expected absolute filenames.
18 =cut
20 # Common code in the test files
22 .sub main :main
23     load_bytecode 'runtime/parrot/include/parrotlib.pbc'
25     .include 'test_more.pir'
26     plan(6)
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()
34 .end
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' )
45 .end
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')
53 .end
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')
63 .end
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')
71 .end
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
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
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')
97 .end
99 =head1 AUTHOR
101 Bernhard Schmalhofer <Bernhard.Schmalhofer@gmx.de>
103 =head1 SEE ALSO
105 F<runtime/parrot/library/parrotlib.pir>
107 =cut
109 # Local Variables:
110 #   mode: pir
111 #   fill-column: 100
112 # End:
113 # vim: expandtab shiftwidth=4 ft=pir: