12
12
from pygccxml import declarations
13
13
14
14
class tester_t ( parser_test_case .parser_test_case_t ):
15
+ global_ns = None
15
16
def __init__ (self , * args ):
16
17
parser_test_case .parser_test_case_t .__init__ ( self , * args )
17
18
self .header = 'include_all.hpp'
18
19
self .global_ns = None
19
20
20
- def setUp (self ):
21
- if not self .global_ns :
21
+ def setUp (self ):
22
+ if not tester_t .global_ns :
22
23
decls = parser .parse ( [self .header ], self .config )
23
- self .global_ns = declarations .get_global_namespace ( decls )
24
- self .global_ns .init_optimizer ()
24
+ tester_t .global_ns = declarations .get_global_namespace ( decls )
25
+ tester_t .global_ns .init_optimizer ()
26
+ self .global_ns = tester_t .global_ns
25
27
26
28
def test_variable ( self ):
27
29
ns_vars = self .global_ns .namespace ( '::declarations::variables' )
@@ -43,6 +45,9 @@ def test_class( self ):
43
45
cls = ns_vars .class_ ( 'struct_variables_t' )
44
46
dependencies = cls .i_depend_on_them ()
45
47
if '0.9' in cls .compiler :
48
+ #GCCXML R122 adds compiler generated constructors/destructors and operator=
49
+ #to the class, if it has
50
+ dependencies = filter ( lambda d : not d .declaration .is_artificial , dependencies )
46
51
self .failUnless ( len (dependencies ) == 1 )
47
52
else :
48
53
self .failUnless ( len (dependencies ) == 2 ) #compiler generated copy constructor
0 commit comments