[pygccxml-commit] SF.net SVN: pygccxml:[1818] pygccxml_dev/unittests
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2010-01-26 20:14:12
|
Revision: 1818
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1818&view=rev
Author: roman_yakovenko
Date: 2010-01-26 20:14:05 +0000 (Tue, 26 Jan 2010)
Log Message:
-----------
adding new test case and fixing scons warning
Modified Paths:
--------------
pygccxml_dev/unittests/data/binary_parsers/sconstruct
pygccxml_dev/unittests/declarations_tester.py
pygccxml_dev/unittests/test_all.py
Added Paths:
-----------
pygccxml_dev/unittests/gccxml10183_tester.py
Modified: pygccxml_dev/unittests/data/binary_parsers/sconstruct
===================================================================
--- pygccxml_dev/unittests/data/binary_parsers/sconstruct 2010-01-26 19:43:03 UTC (rev 1817)
+++ pygccxml_dev/unittests/data/binary_parsers/sconstruct 2010-01-26 20:14:05 UTC (rev 1818)
@@ -1,16 +1,15 @@
import os
import sys
-opts = Options("options", ARGUMENTS)
+vars = Variables()
-
if 'win32' in sys.platform:
- opts.Add( EnumOption( 'msvc_compiler'
- , 'prefered msvc compiler'
- , 'msvc71'
- , ['msvc71', 'msvc80', 'msvc90'] ) )
+ vars.Add( EnumVariable( 'msvc_compiler'
+ , 'prefered msvc compiler'
+ , 'msvc71'
+ , ['msvc71', 'msvc80', 'msvc90'] ) )
-env = Environment(options = opts)
+env = Environment(variables=vars)
if 'win32' in sys.platform:
Help(opts.GenerateHelpText(env))
Modified: pygccxml_dev/unittests/declarations_tester.py
===================================================================
--- pygccxml_dev/unittests/declarations_tester.py 2010-01-26 19:43:03 UTC (rev 1817)
+++ pygccxml_dev/unittests/declarations_tester.py 2010-01-26 20:14:05 UTC (rev 1818)
@@ -165,8 +165,6 @@
def test_ellipsis( self ):
ns = self.global_ns.ns( 'ellipsis_tester' )
do_smth = ns.mem_fun( 'do_smth' )
- for a in do_smth.arguments:
- print str(a)
self.failUnless( do_smth.has_ellipsis )
do_smth_else = ns.free_fun( 'do_smth_else' )
self.failUnless( do_smth_else.has_ellipsis )
Added: pygccxml_dev/unittests/gccxml10183_tester.py
===================================================================
--- pygccxml_dev/unittests/gccxml10183_tester.py (rev 0)
+++ pygccxml_dev/unittests/gccxml10183_tester.py 2010-01-26 20:14:05 UTC (rev 1818)
@@ -0,0 +1,43 @@
+# Copyright 2004-2008 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 unittest
+import autoconfig
+import parser_test_case
+
+from pygccxml import utils
+from pygccxml import parser
+from pygccxml import declarations
+
+code = \
+"""
+template <typename> class A {};
+template <typename T> void f(A<T> const& a){ A<__typeof__(a)>(); }
+template void f<int>(A<int> const& a);
+"""
+
+class tester_t( parser_test_case.parser_test_case_t ):
+ def __init__(self, *args):
+ parser_test_case.parser_test_case_t.__init__(self, *args)
+
+ def test(self):
+ src_reader = parser.source_reader_t( self.config )
+ global_ns = declarations.get_global_namespace( src_reader.read_string( code ) )
+ a = global_ns.decl( 'A<int>' )
+ f = global_ns.free_fun( 'f' )
+ self.failUnless( f.demangled == 'void f<int>(A<int> const&)' )
+
+
+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()
Modified: pygccxml_dev/unittests/test_all.py
===================================================================
--- pygccxml_dev/unittests/test_all.py 2010-01-26 19:43:03 UTC (rev 1817)
+++ pygccxml_dev/unittests/test_all.py 2010-01-26 20:14:05 UTC (rev 1818)
@@ -56,6 +56,7 @@
import const_volatile_arg_tester
import array_bug_tester
import gccxml10185_tester
+import gccxml10183_tester
testers = [
decl_string_tester
@@ -108,6 +109,7 @@
, const_volatile_arg_tester
, array_bug_tester
, gccxml10185_tester
+ , gccxml10183_tester
]
def create_suite():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|