[pygccxml-commit] SF.net SVN: pygccxml: [1043] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2007-05-27 19:04:19
|
Revision: 1043
http://svn.sourceforge.net/pygccxml/?rev=1043&view=rev
Author: roman_yakovenko
Date: 2007-05-27 12:04:20 -0700 (Sun, 27 May 2007)
Log Message:
-----------
integrating synopsis parser with unit tests
Modified Paths:
--------------
pygccxml_dev/unittests/autoconfig.py
pygccxml_dev/unittests/cache_enums_tester.py
pygccxml_dev/unittests/parser_test_case.py
Modified: pygccxml_dev/unittests/autoconfig.py
===================================================================
--- pygccxml_dev/unittests/autoconfig.py 2007-05-27 18:49:41 UTC (rev 1042)
+++ pygccxml_dev/unittests/autoconfig.py 2007-05-27 19:04:20 UTC (rev 1043)
@@ -30,6 +30,13 @@
pygccxml.declarations.class_t.USE_DEMANGLED_AS_NAME = True
+class cxx_parsers_cfg:
+ gccxml = pygccxml.parser.gccxml_configuration_t( gccxml_path=gccxml_path
+ , working_directory=data_directory )
+
+ synopsis = pygccxml.parser.synopsis_configuration_t( working_directory=data_directory )
+
+
#~ try:
#~ import pydsc
#~ pydsc.include( r'D:\pygccxml_sources\sources\pygccxml_dev' )
Modified: pygccxml_dev/unittests/cache_enums_tester.py
===================================================================
--- pygccxml_dev/unittests/cache_enums_tester.py 2007-05-27 18:49:41 UTC (rev 1042)
+++ pygccxml_dev/unittests/cache_enums_tester.py 2007-05-27 19:04:20 UTC (rev 1043)
@@ -13,7 +13,7 @@
from pygccxml import parser
from pygccxml import declarations
-class tester_t( parser_test_case.parser_test_case_t ):
+class tester_impl_t( parser_test_case.parser_test_case_t ):
COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE
def __init__(self, *args ):
parser_test_case.parser_test_case_t.__init__( self, *args )
@@ -38,13 +38,21 @@
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
+
+class gccxml_tester_t( tester_impl_t ):
+ CXX_PARSER_CFG = autoconfig.cxx_parsers_cfg.gccxml
+
+
def create_suite():
suite = unittest.TestSuite()
- suite.addTest( unittest.makeSuite(tester_t))
+ suite.addTest( unittest.makeSuite(synopsis_tester_t))
+ suite.addTest( unittest.makeSuite(gccxml_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
+ run_suite()
Modified: pygccxml_dev/unittests/parser_test_case.py
===================================================================
--- pygccxml_dev/unittests/parser_test_case.py 2007-05-27 18:49:41 UTC (rev 1042)
+++ pygccxml_dev/unittests/parser_test_case.py 2007-05-27 19:04:20 UTC (rev 1043)
@@ -3,20 +3,26 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
+import pprint
import unittest
import autoconfig
-import pprint
+
import pygccxml
from pygccxml.utils import *
from pygccxml.parser import *
from pygccxml.declarations import *
class parser_test_case_t( unittest.TestCase ):
+
+ CXX_PARSER_CFG = None
+
def __init__(self, *args):
unittest.TestCase.__init__(self, *args)
- self.config = config.config_t( gccxml_path=autoconfig.gccxml_path
- , working_directory=autoconfig.data_directory )
+ if self.CXX_PARSER_CFG:
+ self.config = self.CXX_PARSER_CFG.clone()
+ else:
+ self.config = autoconfig.cxx_parsers_cfg.gccxml.clone()
def _test_type_composition( self, type, expected_compound, expected_base ):
self.failUnless( isinstance( type, expected_compound)
@@ -60,4 +66,4 @@
, "the function's '%s' expected exceptions are '%s' and in reality it is different('%s')" \
% ( calldef.name
, pprint.pformat( [delc.name for delc in exception_decls] )
- , pprint.pformat( [delc.name for delc in exceptions_indeed] ) ) )
\ No newline at end of file
+ , pprint.pformat( [delc.name for delc in exceptions_indeed] ) ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|