[pygccxml-commit] SF.net SVN: pygccxml:[1832] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2010-03-25 21:12:53
|
Revision: 1832 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1832&view=rev Author: roman_yakovenko Date: 2010-03-25 21:12:47 +0000 (Thu, 25 Mar 2010) Log Message: ----------- adding example of treating complex class hierarchy Added Paths: ----------- pyplusplus_dev/unittests/data/inner_base_class_to_be_exported.hpp pyplusplus_dev/unittests/inner_base_class_tester.py Added: pyplusplus_dev/unittests/data/inner_base_class_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/inner_base_class_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/inner_base_class_to_be_exported.hpp 2010-03-25 21:12:47 UTC (rev 1832) @@ -0,0 +1,19 @@ +// Copyright 2004-2008 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) + +#ifndef __inner_base_class_to_be_exported_hpp__ +#define __inner_base_class_to_be_exported_hpp__ + +struct foo1_t{ + struct foo2_t; +}; + +struct foo3_t : public foo1_t +{}; + +struct foo1_t::foo2_t : public foo3_t +{}; + +#endif//__inner_base_class_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/inner_base_class_tester.py =================================================================== --- pyplusplus_dev/unittests/inner_base_class_tester.py (rev 0) +++ pyplusplus_dev/unittests/inner_base_class_tester.py 2010-03-25 21:12:47 UTC (rev 1832) @@ -0,0 +1,41 @@ +# Copyright 2004-2008 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 fundamental_tester_base +from pygccxml import declarations + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'inner_base_class' + + def __init__( self, *args ): + fundamental_tester_base.fundamental_tester_base_t.__init__( + self + , tester_t.EXTENSION_NAME + , *args ) + + def customize( self, mb ): + mb.build_code_creator( self.EXTENSION_NAME ) + foo3 = mb.code_creator.body.creators[0] + del mb.code_creator.body.creators[0] + mb.code_creator.body.creators[0].adopt_creator( foo3, 0) + #mb.class_( 'foo2_t' ).bases[0].access_type = declarations.ACCESS_TYPES.PRIVATE + #mb.class_( 'foo3_t' ).bases[0].access_type = declarations.ACCESS_TYPES.PRIVATE + + def run_tests(self, module): + 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() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |