[pygccxml-commit] SF.net SVN: pygccxml: [1077] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-06-24 04:28:31
|
Revision: 1077 http://svn.sourceforge.net/pygccxml/?rev=1077&view=rev Author: roman_yakovenko Date: 2007-06-23 21:28:27 -0700 (Sat, 23 Jun 2007) Log Message: ----------- committing attributes_tester.py Added Paths: ----------- pygccxml_dev/unittests/attributes_tester.py pygccxml_dev/unittests/data/attributes.hpp Added: pygccxml_dev/unittests/attributes_tester.py =================================================================== --- pygccxml_dev/unittests/attributes_tester.py (rev 0) +++ pygccxml_dev/unittests/attributes_tester.py 2007-06-24 04:28:27 UTC (rev 1077) @@ -0,0 +1,43 @@ +# 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 unittest +import autoconfig +import parser_test_case + +from pygccxml import utils +from pygccxml import parser +from pygccxml import declarations + +class tester_t( parser_test_case.parser_test_case_t ): + global_ns = None + def __init__(self, *args ): + parser_test_case.parser_test_case_t.__init__( self, *args ) + self.header = 'attributes.hpp' + + def setUp(self): + if not tester_t.global_ns: + decls = parser.parse( [self.header], self.config ) + tester_t.global_ns = declarations.get_global_namespace( decls ) + tester_t.global_ns.init_optimizer() + + def test( self ): + numeric = self.global_ns.class_( 'numeric_t' ) + self.failUnless( None is numeric.attributes ) + do_nothing = numeric.mem_fun( 'do_nothing' ) + self.failUnless( "gccxml(no throw)" == do_nothing.attributes ) + arg = do_nothing.arguments[0] + self.failUnless( "gccxml(out)" == arg.attributes ) + +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() Added: pygccxml_dev/unittests/data/attributes.hpp =================================================================== --- pygccxml_dev/unittests/data/attributes.hpp (rev 0) +++ pygccxml_dev/unittests/data/attributes.hpp 2007-06-24 04:28:27 UTC (rev 1077) @@ -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 __atributes_hpp__ +#define __atributes_hpp__ + +#define _out_ __attribute( (gccxml( "out" ) ) ) +#define _sealed_ __attribute( (gccxml( "sealed" ) ) ) +#define _no_throw_ __attribute( (gccxml( "no throw" ) ) ) + +namespace attributes{ + +_sealed_ struct numeric_t{ + + _no_throw_ void do_nothing( _out_ int& x ){} + +}; + +} + +#endif//__atributes_hpp__ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |