Skip to content

Commit ed14817

Browse files
author
roman_yakovenko
committed
adding new test case and fixing scons warning
1 parent a4bd138 commit ed14817

File tree

4 files changed

+51
-9
lines changed

4 files changed

+51
-9
lines changed

unittests/data/binary_parsers/sconstruct

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import os
22
import sys
33

4-
opts = Options("options", ARGUMENTS)
5-
4+
vars = Variables()
65

76
if 'win32' in sys.platform:
8-
opts.Add( EnumOption( 'msvc_compiler'
9-
, 'prefered msvc compiler'
10-
, 'msvc71'
11-
, ['msvc71', 'msvc80', 'msvc90'] ) )
7+
vars.Add( EnumVariable( 'msvc_compiler'
8+
, 'prefered msvc compiler'
9+
, 'msvc71'
10+
, ['msvc71', 'msvc80', 'msvc90'] ) )
1211

13-
env = Environment(options = opts)
12+
env = Environment(variables=vars)
1413

1514
if 'win32' in sys.platform:
1615
Help(opts.GenerateHelpText(env))

unittests/declarations_tester.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ def test_operator_symbol(self):
165165
def test_ellipsis( self ):
166166
ns = self.global_ns.ns( 'ellipsis_tester' )
167167
do_smth = ns.mem_fun( 'do_smth' )
168-
for a in do_smth.arguments:
169-
print str(a)
170168
self.failUnless( do_smth.has_ellipsis )
171169
do_smth_else = ns.free_fun( 'do_smth_else' )
172170
self.failUnless( do_smth_else.has_ellipsis )

unittests/gccxml10183_tester.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2004-2008 Roman Yakovenko.
2+
# Distributed under the Boost Software License, Version 1.0. (See
3+
# accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
import os
7+
import unittest
8+
import autoconfig
9+
import parser_test_case
10+
11+
from pygccxml import utils
12+
from pygccxml import parser
13+
from pygccxml import declarations
14+
15+
code = \
16+
"""
17+
template <typename> class A {};
18+
template <typename T> void f(A<T> const& a){ A<__typeof__(a)>(); }
19+
template void f<int>(A<int> const& a);
20+
"""
21+
22+
class tester_t( parser_test_case.parser_test_case_t ):
23+
def __init__(self, *args):
24+
parser_test_case.parser_test_case_t.__init__(self, *args)
25+
26+
def test(self):
27+
src_reader = parser.source_reader_t( self.config )
28+
global_ns = declarations.get_global_namespace( src_reader.read_string( code ) )
29+
a = global_ns.decl( 'A<int>' )
30+
f = global_ns.free_fun( 'f' )
31+
self.failUnless( f.demangled == 'void f<int>(A<int> const&)' )
32+
33+
34+
def create_suite():
35+
suite = unittest.TestSuite()
36+
suite.addTest( unittest.makeSuite(tester_t))
37+
return suite
38+
39+
def run_suite():
40+
unittest.TextTestRunner(verbosity=2).run( create_suite() )
41+
42+
if __name__ == "__main__":
43+
run_suite()

unittests/test_all.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import const_volatile_arg_tester
5757
import array_bug_tester
5858
import gccxml10185_tester
59+
import gccxml10183_tester
5960

6061
testers = [
6162
decl_string_tester
@@ -108,6 +109,7 @@
108109
, const_volatile_arg_tester
109110
, array_bug_tester
110111
, gccxml10185_tester
112+
, gccxml10183_tester
111113
]
112114

113115
def create_suite():

0 commit comments

Comments
 (0)