3 # Copyright (c) 2016 Stefan Seefeld
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)
14 # libs needed for embedding
15 ELIBS=env['LIBS'] + env['PYTHONLIBS']
17 def BPLTest(env, name, sources = None, deps = None):
18 run = env.BoostRunPythonScript(name + '.py')
20 for source in sources:
22 env.PythonExtension(source != name and source or (source + '_ext'), source + '.cpp')
25 Depends(run, env.PythonExtension(name + '_ext', name + '.cpp'))
30 env.AddMethod(BPLTest)
32 env.AppendENVPath('PYTHONPATH', Dir('.').path)
35 tests+=env.BPLTest('crossmod_exception', ['crossmod_exception_a', 'crossmod_exception_b'])
37 for test in [('injected',),
41 ('boost_shared_ptr',),
42 ('enable_shared_from_this',),
46 ('wrapper_held_type',),
50 ('exception_translator',),
51 ('test_enum', ['enum_ext']),
52 ('test_cltree', ['cltree']),
53 ('newtest', ['m1', 'm2']),
55 ('keywords_test', ['keywords']),
56 ('test_pointer_adoption',),
58 ('operators_wrapper',),
68 ('virtual_functions',),
76 ('multi_arg_constructor',),
77 ('iterator', ['iterator', 'input_iterator']),
80 ('crossmod_opaque', ['crossmod_opaque_a', 'crossmod_opaque_b']),
90 ('vector_indexing_suite',),
92 tests+=env.BPLTest(*test)
98 tests+=env.BPLTest(*test)
101 ('polymorphism2_auto_ptr',),
104 tests+=env.BPLTest(*test)
107 test = env.BoostRunPythonScript('test_builtin_converters.py')
110 env.PythonExtension('builtin_converters_ext', ['test_builtin_converters.cpp'])
113 test = env.BoostRunPythonScript('map_indexing_suite.py')
116 env.PythonExtension('map_indexing_suite_ext', [
117 'map_indexing_suite.cpp',
118 'int_map_indexing_suite.cpp',
119 'a_map_indexing_suite.cpp'])
123 tests+=env.BoostRunTest('import_', 'import_.cpp', '${SOURCES[0]} ${SOURCES[1]}', 'import_.py', LIBS=ELIBS)
125 tests+=env.BoostCompileTest('indirect_traits_test')
126 tests+=env.BoostRunTests(['destroy_test',
127 'pointer_type_id_test',
131 'result'], LIBS=ELIBS)
133 tests+=env.BoostCompileTests(['string_literal',
136 'copy_ctor_mutates_rhs'])
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')
143 if platform.system() == 'Windows':
144 tests+=env.BPLTest('calling_conventions')
145 tests+=env.BPLTest('calling_conventions_mf')
148 numpy_env = env.Clone()
149 numpy_env.BoostUseLib('numpy')
150 for test in [('numpy/dtype',),
152 ('numpy/templates',),
156 tests+=numpy_env.BPLTest(*test)
159 env.BoostTestSummary(tests)