コード例 #1
0
 def test_and_matcher( self ):
     criteria1 = declarations.regex_matcher_t( 'oper.*'
                                                , lambda decl: decl.name )
     criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC )
     found = declarations.matcher.find( criteria1 & criteria2, self.global_ns )
     found = filter( lambda d: not d.is_artificial, found )
     self.failUnless( len( found ) <= 6 )
コード例 #2
0
 def test_regex(self):
     criteria = declarations.regex_matcher_t(
         'oper.*',
         lambda decl: decl.name)
     operators = declarations.matcher.find(criteria, self.global_ns)
     operators = [d for d in operators if not d.is_artificial]
     self.failUnless(6 == len(operators))
コード例 #3
0
 def test_not_matcher(self):
     criteria1 = declarations.regex_matcher_t(
         'oper.*',
         lambda decl: decl.name)
     found = declarations.matcher.find(~(~criteria1), self.global_ns)
     found = [d for d in found if not d.is_artificial]
     self.failUnless(len(found) == 6)
コード例 #4
0
ファイル: filters_tester.py プロジェクト: gccxml/pygccxml
 def test_and_matcher(self):
     criteria1 = declarations.regex_matcher_t(
         'oper.*',
         lambda decl: decl.name)
     criteria2 = declarations.access_type_matcher_t(
         declarations.ACCESS_TYPES.PUBLIC)
     found = declarations.matcher.find(
         criteria1 & criteria2,
         self.global_ns)
     found = [d for d in found if not d.is_artificial]
     self.assertTrue(len(found) <= 6)
コード例 #5
0
    def test_or_matcher( self ):
        criteria1 = declarations.regex_matcher_t( 'oper.*'
                                                   , lambda decl: decl.name )
        criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC )
        found = declarations.matcher.find( criteria1 | criteria2, self.global_ns )

        if '0.9' in found[0].compiler:
            found = filter( lambda d: not d.is_artificial, found )
            self.failUnless( 15 <= len( found ) <= 21) 
        else:
            self.failUnless( 19 <= len( found ) <= 25)
コード例 #6
0
    def test_or_matcher( self ):
        criteria1 = declarations.regex_matcher_t( 'oper.*'
                                                   , lambda decl: decl.name )
        criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC )
        found = declarations.matcher.find( criteria1 | criteria2, self.declarations )

        if '0.9' in found[0].compiler:
            #2 empty classes, this compiler doesn't generate constructor and copy constructor
            self.failUnless( 15 <= len( found ) <= 21) 
        else:
            self.failUnless( 19 <= len( found ) <= 25)
コード例 #7
0
ファイル: filters_tester.py プロジェクト: Artoria2e5/pygccxml
    def test_or_matcher(self):
        criteria1 = declarations.regex_matcher_t(
            "oper.*",
            lambda decl: decl.name)
        criteria2 = declarations.access_type_matcher_t(
            declarations.ACCESS_TYPES.PUBLIC)
        found = declarations.matcher.find(
            criteria1 | criteria2,
            self.global_ns)

        if "CastXML" in utils.xml_generator:
            found = [d for d in found if not d.is_artificial]
            self.assertTrue(len(found) != 35)
        elif "0.9" in utils.xml_generator:
            found = [d for d in found if not d.is_artificial]
            self.assertTrue(15 <= len(found) <= 21)
        else:
            self.assertTrue(19 <= len(found) <= 25)
コード例 #8
0
ファイル: recursive_tester.py プロジェクト: CTrauma/pypp11
    def customize( self, mb ):
        matcher = ~declarations.namespace_matcher_t()
        matcher = matcher & declarations.regex_matcher_t( '.*skip.*' )

        decls = mb.decls( matcher )
        decls.ignore = True
        
        mb.build_code_creator( self.EXTENSION_NAME )

        matcher = declarations.match_declaration_t( name='skip_a' )        
        found = code_creators.creator_finder.find_by_declaration( matcher
                                                                  , mb.code_creator.creators )
        self.failUnless( not found, "'skip_a' declaration should not be exported" )
        
        matcher = declarations.match_declaration_t( name='skip_b' )        
        found = code_creators.creator_finder.find_by_declaration( matcher
                                                                  , mb.code_creator.creators )
        self.failUnless( not found, "'skip_b' declaration should not be exported" )                                                          
コード例 #9
0
ファイル: filters_tester.py プロジェクト: gccxml/pygccxml
    def test_or_matcher(self):
        criteria1 = declarations.regex_matcher_t(
            "oper.*",
            lambda decl: decl.name)
        criteria2 = declarations.access_type_matcher_t(
            declarations.ACCESS_TYPES.PUBLIC)
        found = declarations.matcher.find(
            criteria1 | criteria2,
            self.global_ns)

        if self.xml_generator_from_xml_file.is_castxml:
            found = [d for d in found if not d.is_artificial]
            self.assertTrue(len(found) != 35)
        elif self.xml_generator_from_xml_file.is_gccxml_09 or \
                self.xml_generator_from_xml_file.is_gccxml_09_buggy:
            found = [d for d in found if not d.is_artificial]
            self.assertTrue(15 <= len(found) <= 21)
        else:
            self.assertTrue(19 <= len(found) <= 25)
コード例 #10
0
    def customize(self, mb):
        matcher = ~declarations.namespace_matcher_t()
        matcher = matcher & declarations.regex_matcher_t('.*skip.*')

        decls = mb.decls(matcher)
        decls.ignore = True

        mb.build_code_creator(self.EXTENSION_NAME)

        matcher = declarations.match_declaration_t(name='skip_a')
        found = code_creators.creator_finder.find_by_declaration(
            matcher, mb.code_creator.creators)
        self.assertTrue(not found,
                        "'skip_a' declaration should not be exported")

        matcher = declarations.match_declaration_t(name='skip_b')
        found = code_creators.creator_finder.find_by_declaration(
            matcher, mb.code_creator.creators)
        self.assertTrue(not found,
                        "'skip_b' declaration should not be exported")
コード例 #11
0
 def test_not_matcher(self):
     criteria1 = declarations.regex_matcher_t('oper.*',
                                              lambda decl: decl.name)
     found = declarations.matcher.find(~(~criteria1), self.global_ns)
     found = filter(lambda d: not d.is_artificial, found)
     self.failUnless(len(found) == 6)
コード例 #12
0
 def test_regex( self ):       
     criteria = declarations.regex_matcher_t( 'oper.*'
                                              ,  lambda decl: decl.name )
     operators = declarations.matcher.find( criteria, self.declarations )
     self.failUnless( 6 == len(operators) )
コード例 #13
0
ファイル: filters_tester.py プロジェクト: thewtex/pygccxml
 def test_regex(self):
     criteria = declarations.regex_matcher_t('oper.*',
                                             lambda decl: decl.name)
     operators = declarations.matcher.find(criteria, self.global_ns)
     operators = [d for d in operators if not d.is_artificial]
     self.assertTrue(6 == len(operators))
コード例 #14
0
ファイル: filters_tester.py プロジェクト: thewtex/pygccxml
 def test_not_matcher(self):
     criteria1 = declarations.regex_matcher_t('oper.*',
                                              lambda decl: decl.name)
     found = declarations.matcher.find(~(~criteria1), self.global_ns)
     found = [d for d in found if not d.is_artificial]
     self.assertTrue(len(found) == 6)
コード例 #15
0
 def test_regex(self):
     criteria = declarations.regex_matcher_t('oper.*',
                                             lambda decl: decl.name)
     operators = declarations.matcher.find(criteria, self.global_ns)
     operators = filter(lambda d: not d.is_artificial, operators)
     self.failUnless(6 == len(operators))
コード例 #16
0
 def test_not_matcher( self ):
     criteria1 = declarations.regex_matcher_t( 'oper.*'
                                                , lambda decl: decl.name )
     found = declarations.matcher.find( ~( ~criteria1 ), self.declarations )
     self.failUnless( len( found ) == 6 )
コード例 #17
0
 def test_and_matcher( self ):
     criteria1 = declarations.regex_matcher_t( 'oper.*'
                                                , lambda decl: decl.name )
     criteria2 = declarations.access_type_matcher_t( declarations.ACCESS_TYPES.PUBLIC )
     found = declarations.matcher.find( criteria1 & criteria2, self.declarations )
     self.failUnless( len( found ) <= 6 )