Update of /cvsroot/pygccxml/source/pyplusplus/unittests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8117/pyplusplus/unittests
Modified Files:
test_all.py
Added Files:
mdecl_wrapper_tester.py
Log Message:
I created new multiple declarations class.
--- NEW FILE: mdecl_wrapper_tester.py ---
# Copyright 2004 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import sys
import unittest
import autoconfig
from pygccxml import parser
from pygccxml import declarations
from pyplusplus import decl_wrappers
from pyplusplus import module_builder
class tester_t(unittest.TestCase):
def _get_files( self ):
files = [
'enums_to_be_exported.hpp'
, 'free_functions_to_be_exported.hpp'
, 'free_operators_to_be_exported.hpp'
, 'global_variables_to_be_exported.hpp'
, 'index_operator_to_be_exported.hpp'
, 'member_functions_to_be_exported.hpp'
]
return map( lambda f: os.path.join( autoconfig.data_directory, f )
, files )
def test(self):
config = parser.config_t( gccxml_path=autoconfig.gccxml_path
, include_paths=[autoconfig.boost_path]
, undefine_symbols=['__MINGW32__'])
mb = module_builder.module_builder_t(
'dummy'
, self._get_files()
, config )
classes = filter( lambda d: isinstance( d, decl_wrappers.class_t )
, declarations.make_flatten( mb.declarations ) )
mdw = decl_wrappers.mdecl_wrapper_t( classes )
#check set to property functionality
for d in mdw:
d.always_expose_using_scope = False
mdw.always_expose_using_scope = True
all_true = True
for d in mdw:
all_true &= d.always_expose_using_scope
self.failUnless( all_true )
#check call method functionality
for d in mdw:
d.ignore = True
mdw.include()
all_false = False
for d in mdw:
all_true |= d.ignore
self.failUnless( not all_false )
#check for exception:
try:
mdw.call_policies = None
self.fail( "Runtime error has not been raised." )
except RuntimeError:
pass
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
return suite
def run_suite():
unittest.TextTestRunner(verbosity=2).run( create_suite() )
if __name__ == "__main__":
run_suite()
Index: test_all.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/test_all.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** test_all.py 5 Mar 2006 05:51:30 -0000 1.32
--- test_all.py 6 Mar 2006 05:02:41 -0000 1.33
***************
*** 42,45 ****
--- 42,47 ----
import optional_tester
import index_operator_tester
+ import dwrapper_printer_tester
+ import mdecl_wrapper_tester
def create_suite(times):
***************
*** 80,83 ****
--- 82,87 ----
, optional_tester
, index_operator_tester
+ , dwrapper_printer_tester
+ , mdecl_wrapper_tester
]
|