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