]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/python/test/SConscript
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / python / test / SConscript
1 # -*- python -*-
2 #
3 # Copyright (c) 2016 Stefan Seefeld
4 # All rights reserved.
5 #
6 # Distributed under the Boost Software License, Version 1.0.
7 # (See accompanying file LICENSE_1_0.txt or copy at
8 # http://www.boost.org/LICENSE_1_0.txt)
9
10 import platform
11
12 Import('env')
13
14 # libs needed for embedding
15 ELIBS=env['LIBS'] + env['PYTHONLIBS']
16
17 def BPLTest(env, name, sources = None, deps = None):
18 run = env.BoostRunPythonScript(name + '.py')
19 if sources:
20 for source in sources:
21 Depends(run,
22 env.PythonExtension(source != name and source or (source + '_ext'), source + '.cpp')
23 )
24 else:
25 Depends(run, env.PythonExtension(name + '_ext', name + '.cpp'))
26 if deps:
27 Depends(run, deps)
28 return run
29
30 env.AddMethod(BPLTest)
31
32 env.AppendENVPath('PYTHONPATH', Dir('.').path)
33
34 tests=[]
35 tests+=env.BPLTest('crossmod_exception', ['crossmod_exception_a', 'crossmod_exception_b'])
36
37 for test in [('injected',),
38 ('properties',),
39 ('return_arg',),
40 ('staticmethod',),
41 ('boost_shared_ptr',),
42 ('enable_shared_from_this',),
43 ('andreas_beyer',),
44 ('polymorphism',),
45 ('polymorphism2',),
46 ('wrapper_held_type',),
47 ('minimal',),
48 ('args',),
49 ('raw_ctor',),
50 ('exception_translator',),
51 ('test_enum', ['enum_ext']),
52 ('test_cltree', ['cltree']),
53 ('newtest', ['m1', 'm2']),
54 ('const_argument',),
55 ('keywords_test', ['keywords']),
56 ('test_pointer_adoption',),
57 ('operators',),
58 ('operators_wrapper',),
59 ('callbacks',),
60 ('defaults',),
61 ('object',),
62 ('list',),
63 ('long',),
64 ('dict',),
65 ('tuple',),
66 ('str',),
67 ('slice',),
68 ('virtual_functions',),
69 ('back_reference',),
70 ('implicit',),
71 ('data_members',),
72 ('ben_scott1',),
73 ('bienstman1',),
74 ('bienstman2',),
75 ('bienstman3',),
76 ('multi_arg_constructor',),
77 ('iterator', ['iterator', 'input_iterator']),
78 ('stl_iterator',),
79 ('extract',),
80 ('crossmod_opaque', ['crossmod_opaque_a', 'crossmod_opaque_b']),
81 ('opaque',),
82 # ('voidptr',),
83 ('pickle1',),
84 ('pickle2',),
85 ('pickle3',),
86 ('pickle4',),
87 ('nested',),
88 ('docstring',),
89 ('pytype_function',),
90 ('vector_indexing_suite',),
91 ('pointer_vector',)]:
92 tests+=env.BPLTest(*test)
93
94 if env['CXX11']:
95 for test in [
96 ('shared_ptr',),
97 ]:
98 tests+=env.BPLTest(*test)
99 else:
100 for test in [
101 ('polymorphism2_auto_ptr',),
102 ('auto_ptr',),
103 ]:
104 tests+=env.BPLTest(*test)
105
106
107 test = env.BoostRunPythonScript('test_builtin_converters.py')
108 Depends(
109 test,
110 env.PythonExtension('builtin_converters_ext', ['test_builtin_converters.cpp'])
111 )
112 tests+=test
113 test = env.BoostRunPythonScript('map_indexing_suite.py')
114 Depends(
115 test,
116 env.PythonExtension('map_indexing_suite_ext', [
117 'map_indexing_suite.cpp',
118 'int_map_indexing_suite.cpp',
119 'a_map_indexing_suite.cpp'])
120 )
121 tests+=test
122
123 tests+=env.BoostRunTest('import_', 'import_.cpp', '${SOURCES[0]} ${SOURCES[1]}', 'import_.py', LIBS=ELIBS)
124
125 tests+=env.BoostCompileTest('indirect_traits_test')
126 tests+=env.BoostRunTests(['destroy_test',
127 'pointer_type_id_test',
128 'bases',
129 'if_else',
130 'pointee',
131 'result'], LIBS=ELIBS)
132
133 tests+=env.BoostCompileTests(['string_literal',
134 'borrowed',
135 'object_manager',
136 'copy_ctor_mutates_rhs'])
137
138 tests+=env.BoostRunTest('upcast', LIBS=ELIBS)
139 tests+=env.BoostCompileTest('select_holder')
140 tests+=env.BoostRunTest('select_from_python_test', LIBS=ELIBS)
141 tests+=env.BoostCompileTest('select_arg_to_python_test')
142
143 if platform.system() == 'Windows':
144 tests+=env.BPLTest('calling_conventions')
145 tests+=env.BPLTest('calling_conventions_mf')
146
147 if env['NUMPY']:
148 numpy_env = env.Clone()
149 numpy_env.BoostUseLib('numpy')
150 for test in [('numpy/dtype',),
151 ('numpy/ufunc',),
152 ('numpy/templates',),
153 ('numpy/ndarray',),
154 ('numpy/indexing',),
155 ('numpy/shapes',),]:
156 tests+=numpy_env.BPLTest(*test)
157
158
159 env.BoostTestSummary(tests)
160 AlwaysBuild(tests)