[pygccxml-commit] SF.net SVN: pygccxml: [157] pyplusplus_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2006-05-23 20:19:26
|
Revision: 157 Author: roman_yakovenko Date: 2006-05-23 13:19:16 -0700 (Tue, 23 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=157&view=rev Log Message: ----------- fixing bug with hierarchy level 3 - adding unit tests Modified Paths: -------------- pyplusplus_dev/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/unittests/data/hierarchy3_to_be_exported.hpp pyplusplus_dev/unittests/hierarchy3_tester.py Property Changed: ---------------- pyplusplus_dev/unittests/data/ Property changes on: pyplusplus_dev/unittests/data ___________________________________________________________________ Name: svn:ignore - *.obj + *.obj call_policies_to_be_exported.os Added: pyplusplus_dev/unittests/data/hierarchy3_to_be_exported.hpp =================================================================== --- pyplusplus_dev/unittests/data/hierarchy3_to_be_exported.hpp (rev 0) +++ pyplusplus_dev/unittests/data/hierarchy3_to_be_exported.hpp 2006-05-23 20:19:16 UTC (rev 157) @@ -0,0 +1,24 @@ +// 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) + +#ifndef __hierarchy3_to_be_exported_hpp__ +#define __hierarchy3_to_be_exported_hpp__ + +namespace hierarchy3{ + +struct grandpa_t{ + virtual int gp_pure(int i) = 0; +}; + +struct father_t : public grandpa_t{ + virtual int gp_pure(int i){ return i; } +}; + +struct son_t : public father_t +{}; + +} + +#endif//__hierarchy3_to_be_exported_hpp__ Added: pyplusplus_dev/unittests/hierarchy3_tester.py =================================================================== --- pyplusplus_dev/unittests/hierarchy3_tester.py (rev 0) +++ pyplusplus_dev/unittests/hierarchy3_tester.py 2006-05-23 20:19:16 UTC (rev 157) @@ -0,0 +1,44 @@ +# 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 fundamental_tester_base +from pygccxml import declarations +from pyplusplus import code_creators + +class tester_t(fundamental_tester_base.fundamental_tester_base_t): + EXTENSION_NAME = 'hierarchy3' + + 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( 'hierarchy3' ) + find = code_creators.creator_finder.find_by_declaration_single + matcher = declarations.match_declaration_t( name='son_t' + , type=declarations.class_t) + found = find( matcher, mb.code_creator.body.creators ) + self.failUnless( found ) + self.failUnless( not found.wrapper ) + self.failUnless( 0 == len( found.creators ) ) + + 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() \ No newline at end of file Modified: pyplusplus_dev/unittests/test_all.py =================================================================== --- pyplusplus_dev/unittests/test_all.py 2006-05-23 19:48:13 UTC (rev 156) +++ pyplusplus_dev/unittests/test_all.py 2006-05-23 20:19:16 UTC (rev 157) @@ -50,7 +50,8 @@ import factory_tester import private_assign_tester import protected_tester -import indexing_suites_tester +import indexing_suites_tester +import hierarchy3_tester def create_suite(times): testers = [ @@ -98,7 +99,8 @@ , factory_tester , private_assign_tester , protected_tester - , indexing_suites_tester + , indexing_suites_tester + , hierarchy3_tester ] main_suite = unittest.TestSuite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |