[pygccxml-commit] SF.net SVN: pygccxml: [1129] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-11-07 21:24:53
|
Revision: 1129
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1129&view=rev
Author: roman_yakovenko
Date: 2007-11-07 13:24:58 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
testing GCCXML 0.9 related changes
Modified Paths:
--------------
pygccxml_dev/unittests/autoconfig.py
pygccxml_dev/unittests/cache_enums_tester.py
pygccxml_dev/unittests/data/core_cache.hpp
pygccxml_dev/unittests/data/type_traits.hpp
pygccxml_dev/unittests/declarations_tester.py
pygccxml_dev/unittests/demangled_tester.py
pygccxml_dev/unittests/patcher_tester.py
Modified: pygccxml_dev/unittests/autoconfig.py
===================================================================
--- pygccxml_dev/unittests/autoconfig.py 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/autoconfig.py 2007-11-07 21:24:58 UTC (rev 1129)
@@ -11,17 +11,18 @@
#import pychecker.checker
compiler = None
-gccxml_path = ''
data_directory = os.path.abspath( os.path.join( os.curdir, 'data' ) )
build_dir = os.path.abspath( os.path.join( os.curdir, 'temp' ) )
-if 'roman' in getpass.getuser():
- if sys.platform == 'win32':
- compiler = 'msvc71'
- gccxml_path = r'D:/dev/gccxml/gccxml.exe'
- else:
- gccxml_path = '/home/roman/gccxml/bin/gccxml'
+gccxml_07_path = os.path.abspath( os.path.join( '..', '..', 'gccxml_bin', 'v07', sys.platform, 'bin' ) )
+gccxml_09_path = os.path.abspath( os.path.join( '..', '..', 'gccxml_bin', 'v09', sys.platform, 'bin' ) )
+gccxml_path = gccxml_09_path
+gccxml_version = '__GCCXML_09__'
+
+if sys.platform == 'win32':
+ compiler = 'msvc71'
+
try:
import pygccxml
print 'unittests will run on INSTALLED version'
@@ -35,6 +36,7 @@
class cxx_parsers_cfg:
gccxml = pygccxml.parser.gccxml_configuration_t( gccxml_path=gccxml_path
, working_directory=data_directory
+ , define_symbols=[ gccxml_version ]
, compiler=compiler )
synopsis = pygccxml.parser.synopsis_configuration_t( working_directory=data_directory )
Modified: pygccxml_dev/unittests/cache_enums_tester.py
===================================================================
--- pygccxml_dev/unittests/cache_enums_tester.py 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/cache_enums_tester.py 2007-11-07 21:24:58 UTC (rev 1129)
@@ -38,8 +38,9 @@
color2 = declarations.matcher.get_single( enum_matcher, decls2 )
self.failUnless( color1.values == color2.values )
-class synopsis_tester_t( tester_impl_t ):
- CXX_PARSER_CFG = autoconfig.cxx_parsers_cfg.synopsis
+#there is no progress with this parser
+#class synopsis_tester_t( tester_impl_t ):
+# CXX_PARSER_CFG = autoconfig.cxx_parsers_cfg.synopsis
class gccxml_tester_t( tester_impl_t ):
CXX_PARSER_CFG = autoconfig.cxx_parsers_cfg.gccxml
@@ -47,7 +48,7 @@
def create_suite():
suite = unittest.TestSuite()
- suite.addTest( unittest.makeSuite(synopsis_tester_t))
+ #suite.addTest( unittest.makeSuite(synopsis_tester_t))
suite.addTest( unittest.makeSuite(gccxml_tester_t))
return suite
Modified: pygccxml_dev/unittests/data/core_cache.hpp
===================================================================
--- pygccxml_dev/unittests/data/core_cache.hpp 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/data/core_cache.hpp 2007-11-07 21:24:58 UTC (rev 1129)
@@ -22,4 +22,4 @@
#endif//__core_cache_hpp__
-//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch
\ No newline at end of file
+//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch
\ No newline at end of file
Modified: pygccxml_dev/unittests/data/type_traits.hpp
===================================================================
--- pygccxml_dev/unittests/data/type_traits.hpp 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/data/type_traits.hpp 2007-11-07 21:24:58 UTC (rev 1129)
@@ -1,3 +1,4 @@
+
// Copyright 2004 Roman Yakovenko.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -79,10 +80,16 @@
namespace yes{
typedef detail::x x;
+#ifdef __GCCXML_09__
+ typedef detail::y_type y_type;
+#endif//__GCCXML_09__
+
}
namespace no{
typedef std::string string_type;
+#ifdef __GCCXML_07__
typedef detail::y_type y_type;
+#endif//__GCCXML_07__
}
}
Modified: pygccxml_dev/unittests/declarations_tester.py
===================================================================
--- pygccxml_dev/unittests/declarations_tester.py 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/declarations_tester.py 2007-11-07 21:24:58 UTC (rev 1129)
@@ -47,9 +47,16 @@
def test_variables(self):
variables = self.global_ns.namespace( 'variables' )
initialized = self.global_ns.variable( name='initialized' )
- self.failUnless( initialized.value == '10122004'
+
+ expected_value = None
+ if '0.9' in initialized.compiler:
+ expected_value = '10122004ul'
+ else:
+ expected_value = '10122004'
+
+ self.failUnless( initialized.value == expected_value
, "there is a difference between expected value( %s ) and real value(%s) of 'initialized' variable" \
- % ( '10122004', initialized.value ) )
+ % ( expected_value, initialized.value ) )
self._test_type_composition( initialized.type, const_t, long_unsigned_int_t )
static_var = initialized = self.global_ns.variable( name='static_var' )
@@ -173,4 +180,4 @@
unittest.TextTestRunner(verbosity=2).run( create_suite() )
if __name__ == "__main__":
- run_suite()
\ No newline at end of file
+ run_suite()
Modified: pygccxml_dev/unittests/demangled_tester.py
===================================================================
--- pygccxml_dev/unittests/demangled_tester.py 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/demangled_tester.py 2007-11-07 21:24:58 UTC (rev 1129)
@@ -35,8 +35,12 @@
def test( self ):
demangled = self.global_ns.namespace( 'demangled' )
if 32 == self.architecture:
- cls = demangled.class_( 'item_t<3740067437l, 11l, 2147483648l>' )
- self.failUnless( cls._name == 'item_t<0x0deece66d,11,0x080000000>' )
+ if '0.9' in demangled.compiler:
+ cls = demangled.class_( 'item_t<3740067437ul, 11ul, 2147483648ul>' )
+ self.failUnless( cls._name == 'item_t<-554899859ul,11ul,-2147483648ul>' )
+ else:
+ cls = demangled.class_( 'item_t<3740067437l, 11l, 2147483648l>' )
+ self.failUnless( cls._name == 'item_t<0x0deece66d,11,0x080000000>' )
else:
cls = demangled.class_( "item_t<25214903917l, 11l, 2147483648l>" )
self.failUnless( cls._name == 'item_t<25214903917,11,2147483648>' )
@@ -67,4 +71,4 @@
unittest.TextTestRunner(verbosity=2).run( create_suite() )
if __name__ == "__main__":
- run_suite()
\ No newline at end of file
+ run_suite()
Modified: pygccxml_dev/unittests/patcher_tester.py
===================================================================
--- pygccxml_dev/unittests/patcher_tester.py 2007-11-07 21:24:10 UTC (rev 1128)
+++ pygccxml_dev/unittests/patcher_tester.py 2007-11-07 21:24:58 UTC (rev 1129)
@@ -27,7 +27,10 @@
def test_numeric_patcher(self):
fix_numeric = self.global_ns.free_fun( 'fix_numeric' )
if 32 == self.architecture:
- self.failUnless( fix_numeric.arguments[0].default_value == u"0xffffffffffffffff" )
+ if '0.9' in fix_numeric.compiler:
+ self.failUnless( fix_numeric.arguments[0].default_value == u"0xffffffffffffffffu" )
+ else:
+ self.failUnless( fix_numeric.arguments[0].default_value == u"0xffffffffffffffff" )
else:
self.failUnless( fix_numeric.arguments[0].default_value == u"0ffffffff" )
@@ -37,7 +40,10 @@
def test_function_call_patcher(self):
fix_function_call = self.global_ns.free_fun( 'fix_function_call' )
- self.failUnless( fix_function_call.arguments[0].default_value == u"function_call::calc( 1, 2, 3 )" )
+ if '0.9' in fix_function_call.compiler:
+ self.failUnless( fix_function_call.arguments[0].default_value == u"function_call::calc(1, 2, 3)" )
+ else:
+ self.failUnless( fix_function_call.arguments[0].default_value == u"function_call::calc( 1, 2, 3 )" )
def test_fundamental_patcher(self):
fcall = self.global_ns.free_fun( 'fix_fundamental' )
@@ -45,13 +51,21 @@
def test_constructor_patcher(self):
typedef__func = self.global_ns.free_fun( 'typedef__func' )
- self.failUnless( typedef__func.arguments[0].default_value == u"::typedef_::alias( )" )
+ if '0.9' in typedef__func.compiler:
+ self.failUnless( typedef__func.arguments[0].default_value == u"typedef_::original_name()" )
+ else:
+ self.failUnless( typedef__func.arguments[0].default_value == u"::typedef_::alias( )" )
if 32 == self.architecture:
clone_tree = self.global_ns.free_fun( 'clone_tree' )
- default_values = [
- 'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >()'
- , 'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >((&allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >()))'
- ]
+ default_values = []
+ if '0.9' in clone_tree.compiler:
+ default_values = [
+ ]
+ else:
+ default_values = [
+ 'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >()'
+ , 'vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >((&allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >()))'
+ ]
self.failUnless( clone_tree.arguments[0].default_value in default_values)
class tester_32_t( tester_impl_t ):
@@ -59,7 +73,6 @@
def __init__(self, *args):
tester_impl_t.__init__(self, 32, *args)
-
def setUp( self ):
if not tester_32_t.global_ns:
reader = parser.source_reader_t( self.config )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|