[pygccxml-commit] SF.net SVN: pygccxml: [1335] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-06-12 06:24:36
|
Revision: 1335 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1335&view=rev Author: roman_yakovenko Date: 2008-06-11 23:24:44 -0700 (Wed, 11 Jun 2008) Log Message: ----------- small unittest fixes Modified Paths: -------------- pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/core_tester.py Modified: pygccxml_dev/unittests/autoconfig.py =================================================================== --- pygccxml_dev/unittests/autoconfig.py 2008-06-11 19:45:11 UTC (rev 1334) +++ pygccxml_dev/unittests/autoconfig.py 2008-06-12 06:24:44 UTC (rev 1335) @@ -52,11 +52,13 @@ if sys.platform == 'win32': from pygccxml.msvc import pdb pdb_file = os.path.join( data_directory, 'msvc_build', 'Debug', 'msvc_build.pdb' ) - pdb_loader = pdb.decl_loader_t( pdb_file ) - pdb_loader.read() + if os.path.exists( pdb_file ): + pdb_loader = pdb.decl_loader_t( pdb_file ) + pdb_loader.read() def get_pdb_global_ns(): - return cxx_parsers_cfg.pdb_loader.global_ns + if cxx_parsers_cfg.pdb_loader: + return cxx_parsers_cfg.pdb_loader.global_ns #~ try: #~ import pydsc Modified: pygccxml_dev/unittests/core_tester.py =================================================================== --- pygccxml_dev/unittests/core_tester.py 2008-06-11 19:45:11 UTC (rev 1334) +++ pygccxml_dev/unittests/core_tester.py 2008-06-12 06:24:44 UTC (rev 1335) @@ -17,6 +17,12 @@ from pygccxml.parser import * from pygccxml.declarations import * +def is_sub_path( root, some_path ): + root = normalize_path( root ) + some_path = normalize_path( some_path ) + return some_path.startswith( root ) + + class core_t( parser_test_case.parser_test_case_t ): """Tests core algorithms of GCC-XML and GCC-XML file reader. Those most white-box testing. @@ -68,7 +74,7 @@ def _test_ns_membership(self, ns, enum_name ): unnamed_enum = ns.enum( lambda d: d.name == '' \ - and d.location.file_name.startswith( autoconfig.data_directory ) + and is_sub_path( autoconfig.data_directory, d.location.file_name ) , recursive=False ) self.failUnless( unnamed_enum in ns.declarations , "namespace '%s' does not contains unnamed enum." % ns.name ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |