|
8 | 8 | import parser_test_case
|
9 | 9 |
|
10 | 10 | import pygccxml
|
11 |
| -from pygccxml.utils import * |
12 |
| -from pygccxml.parser import * |
13 |
| -from pygccxml.declarations import * |
| 11 | +from pygccxml import utils |
| 12 | +from pygccxml import parser |
| 13 | +from pygccxml import declarations |
14 | 14 |
|
15 | 15 | class tester_t( parser_test_case.parser_test_case_t ):
|
| 16 | + global_ns = None |
16 | 17 | def __init__(self, *args):
|
17 | 18 | parser_test_case.parser_test_case_t.__init__(self, *args)
|
| 19 | + self.header = 'declarations_calldef.hpp' |
| 20 | + self.global_ns = None |
| 21 | + |
| 22 | + def setUp(self): |
| 23 | + if not tester_t.global_ns: |
| 24 | + decls = parser.parse( [self.header], self.config ) |
| 25 | + tester_t.global_ns = declarations.get_global_namespace( decls ) |
| 26 | + tester_t.global_ns.init_optimizer() |
| 27 | + self.global_ns = tester_t.global_ns |
18 | 28 |
|
19 | 29 | def test_compound_argument_type(self):
|
20 |
| - reader = source_reader_t( self.config ) |
21 |
| - decls = reader.read_file( 'declarations_calldef.hpp' ) |
22 |
| - do_smth = find_declaration( decls, type=member_function_t, name='do_smth' ) |
23 |
| - self.failUnless( do_smth, "unable to find calldefs_t.do_smth" ) |
| 30 | + do_smth = self.global_ns.calldefs( 'do_smth' ) |
| 31 | + self.failUnless( do_smth, "unable to find do_smth" ) |
24 | 32 | cpptype = do_smth.function_type()
|
25 | 33 |
|
26 | 34 | def create_suite():
|
|
0 commit comments