mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 05:22:45 +00:00
Boost.Python. The major change is that, instead of being
boost::function2<PyObject*,PyObject*,PyObject*>, py_function is now a
runtime-polymorphic wrapper for compile-time polymorphic
behavior (just like function) of our own which carries more
information/behaviors. In particular, you can retrieve an array of
c-strings describing the types in the function signature.
Additionally, the minimum and maximum arity are stored in the
py_function object instead of in the 'function' object which wraps it.
* data_members.hpp -
Adjustments for the new py_function. Workarounds for CodeWarrior
Pro 8.3 bugs in function template argument deduction with
pointers-to-members.
* has_back_reference.hpp, test/back_reference.cpp,
test/select_holder.cpp -
Updated to follow the metafunction protocol
* init.hpp, detail/defaults_gen.hpp -
Make Keywords a more-specific type in function signatures to
prevent string literals that show up as char[N] from binding to
the wrong argument (at least Intel 7.1 for Windows does this).
* make_function.hpp -
Adjustments for the new py_function. Arities are now computed
by caller<>.
* opaque_pointer_converter.hpp, type_id.hpp -
Use BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS facilities;
generate specializations that all compilers can handle.
* raw_function.hpp -
Adjustments for the new py_function.
* caller.hpp -
Added arity and signature type name reporting.
* detail/config.hpp
Enable __declspec(dllexport) for Cygwin, thereby fixing the
recent horrible Cygwin linking problems.
* detail/msvc_typeinfo.hpp -
Always pass boost::type<T>* explicitly, thereby working around
incompatible notions of how to specialize function templates with
default arguments on various compilers.
* object/function.hpp
, object/function_handle.hpp
, object/function_object.hpp
, object/function_object.cpp
Adjustments for the new py_function. Arities are carried by
py_function.
* object/iterator.hpp, object/iterator.cpp
Adjustments for the new py_function; we have to compute a
signature of types to construct it with.
* object/py_function.hpp
Removed dependency on boost::function; see the comment at the
top of this entry for more details.
* object/select_holder.hpp
Clean up to more closely follow MPL idioms.
* test/Jamfile -
Adjust the embedding test for the new Cygwin use of declspec.
Update bases and pointee tests with missing properties.
* test/input_iterator.cpp -
Updates for the new iterator adaptors.
* test/opaque.py -
Add Python encoding comment to suppress PendinDeprecationWarning
with recent Python builds.
* test/str.cpp
Pass a Python long instead of a float to string.expandtabs,
suppressing a PendinDeprecationWarning with recent Python builds.
* libs/utility/counting_iterator_example.cpp
Borland workaround
* libs/utility/indirect_iterator_example.cpp
const-correctness fix.
*
[SVN r19247]
196 lines
5.0 KiB
Plaintext
196 lines
5.0 KiB
Plaintext
#
|
|
# To run all tests quietly: jam test
|
|
# To run all tests with verbose output: jam -sPYTHON_TEST_ARGS=-v test
|
|
#
|
|
subproject libs/python/test ;
|
|
|
|
# bring in the rules for python
|
|
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
|
|
include python.jam ;
|
|
# bring in rules for testing
|
|
SEARCH on testing.jam = $(BOOST_BUILD_PATH) ;
|
|
include testing.jam ;
|
|
|
|
# Convenience rule makes declaring tests faster
|
|
rule bpl-test ( name ? : files * : requirements * )
|
|
{
|
|
files ?= $(name).py $(name).cpp ;
|
|
|
|
local modules ;
|
|
local py ;
|
|
for local f in $(files)
|
|
{
|
|
if $(f:S) = .py
|
|
{
|
|
if $(py)
|
|
{
|
|
EXIT too many python drivers specified: "$(py)" "$(f)" ;
|
|
}
|
|
py = $(f) ;
|
|
}
|
|
}
|
|
|
|
name ?= $(py:S=) ;
|
|
|
|
for local f in $(files)
|
|
{
|
|
if $(f:S) != .py
|
|
{
|
|
local m = $(f:S=) ;
|
|
|
|
if $(m) = $(py:S=)
|
|
{
|
|
m = $(name) ;
|
|
|
|
if $(m) = $(py:S=)
|
|
{
|
|
m = $(m)_ext ;
|
|
}
|
|
}
|
|
extension $(m) : $(f) <dll>../build/boost_python : $(requirements) ;
|
|
modules += $(m) ;
|
|
}
|
|
}
|
|
|
|
boost-python-runtest $(name) : $(py) <pyd>$(modules) ;
|
|
}
|
|
|
|
run ../test/embedding.cpp <lib>../build/boost_python
|
|
: # program args
|
|
: # input files
|
|
: # requirements
|
|
$(PYTHON_PROPERTIES)
|
|
<define>BOOST_PYTHON_STATIC_LIB
|
|
<define>BOOST_PYTHON_STATIC_MODULE
|
|
<library-path>$(PYTHON_LIB_PATH)
|
|
<$(gcc-compilers)><debug-python><library-path>$(CYGWIN_PYTHON_DEBUG_DLL_PATH)
|
|
<$(gcc-compilers)><*><library-path>$(CYGWIN_PYTHON_DLL_PATH)
|
|
<find-library>$(PYTHON_EMBEDDED_LIBRARY) ;
|
|
|
|
bpl-test return_arg ;
|
|
bpl-test staticmethod ;
|
|
bpl-test shared_ptr ;
|
|
bpl-test polymorphism ;
|
|
bpl-test auto_ptr ;
|
|
bpl-test minimal ;
|
|
bpl-test args ;
|
|
bpl-test numpy ;
|
|
bpl-test enum ;
|
|
bpl-test exception_translator ;
|
|
bpl-test pearu1 : test_cltree.py cltree.cpp ;
|
|
bpl-test try : newtest.py m1.cpp m2.cpp ;
|
|
|
|
extension builtin_converters : test_builtin_converters.cpp <dll>../build/boost_python ;
|
|
boost-python-runtest builtin_converters : test_builtin_converters.py <pyd>builtin_converters ;
|
|
|
|
bpl-test test_pointer_adoption ;
|
|
bpl-test operators ;
|
|
bpl-test callbacks ;
|
|
bpl-test defaults ;
|
|
|
|
bpl-test object ;
|
|
bpl-test list ;
|
|
bpl-test long ;
|
|
bpl-test dict ;
|
|
bpl-test tuple ;
|
|
bpl-test str ;
|
|
|
|
bpl-test virtual_functions ;
|
|
bpl-test back_reference ;
|
|
bpl-test implicit ;
|
|
bpl-test data_members ;
|
|
|
|
bpl-test ben_scott1 ;
|
|
|
|
bpl-test bienstman1 ;
|
|
bpl-test bienstman2 ;
|
|
bpl-test bienstman3 ;
|
|
|
|
# A bug in the Win32 intel compilers causes compilation of one of our
|
|
# tests to take forever when debug symbols are enabled. This rule
|
|
# turns them off when added to the requirements section
|
|
rule turn-off-intel-debug-symbols ( toolset variant : properties * )
|
|
{
|
|
if $(NT) && [ MATCH (.*intel.*) : $(toolset) ]
|
|
{
|
|
properties = [ difference $(properties) : <debug-symbols>on ] <debug-symbols>off ;
|
|
}
|
|
return $(properties) ;
|
|
}
|
|
|
|
bpl-test multi_arg_constructor
|
|
: # files
|
|
: # requirements
|
|
turn-off-intel-debug-symbols ; # debug symbols slow the build down too much
|
|
|
|
bpl-test iterator : iterator.py iterator.cpp input_iterator.cpp ;
|
|
|
|
bpl-test extract ;
|
|
|
|
bpl-test opaque ;
|
|
|
|
bpl-test pickle1 ;
|
|
bpl-test pickle2 ;
|
|
bpl-test pickle3 ;
|
|
|
|
bpl-test nested ;
|
|
|
|
bpl-test docstring ;
|
|
|
|
if $(TEST_BIENSTMAN_NON_BUGS)
|
|
{
|
|
bpl-test bienstman4 ;
|
|
bpl-test bienstman5 ;
|
|
}
|
|
|
|
# --- unit tests of library components ---
|
|
|
|
local UNIT_TEST_PROPERTIES = $(PYTHON_PROPERTIES) <define>BOOST_PYTHON_SUPPRESS_REGISTRY_INITIALIZATION
|
|
[ difference $(PYTHON_PROPERTIES) : <define>BOOST_PYTHON_DYNAMIC_LIB ] <define>BOOST_PYTHON_STATIC_LIB ;
|
|
|
|
run indirect_traits_test.cpp ;
|
|
run destroy_test.cpp ;
|
|
run pointer_type_id_test.cpp <lib>../../test/build/boost_test_exec_monitor : : : $(UNIT_TEST_PROPERTIES) ;
|
|
run member_function_cast.cpp ;
|
|
run bases.cpp : : : $(UNIT_TEST_PROPERTIES) ;
|
|
run if_else.cpp ;
|
|
run pointee.cpp : : : $(UNIT_TEST_PROPERTIES) ;
|
|
run result.cpp ;
|
|
|
|
compile string_literal.cpp ;
|
|
compile borrowed.cpp : $(UNIT_TEST_PROPERTIES) ;
|
|
compile object_manager.cpp : $(UNIT_TEST_PROPERTIES) ;
|
|
compile copy_ctor_mutates_rhs.cpp : $(UNIT_TEST_PROPERTIES) ;
|
|
|
|
run upcast.cpp <lib>../../test/build/boost_test_exec_monitor
|
|
: # command-line args
|
|
: # input files
|
|
: $(UNIT_TEST_PROPERTIES)
|
|
;
|
|
|
|
run select_holder.cpp <lib>../../test/build/boost_test_exec_monitor
|
|
: # command-line args
|
|
: # input files
|
|
: $(UNIT_TEST_PROPERTIES)
|
|
;
|
|
|
|
|
|
run select_from_python_test.cpp ../src/converter/type_id.cpp <lib>../../test/build/boost_test_exec_monitor
|
|
: # command-line args
|
|
: # input files
|
|
: $(UNIT_TEST_PROPERTIES)
|
|
;
|
|
|
|
run select_arg_to_python_test.cpp ../src/converter/type_id.cpp <lib>../../test/build/boost_test_exec_monitor
|
|
: # command-line args
|
|
: # input files
|
|
: $(UNIT_TEST_PROPERTIES)
|
|
;
|
|
|
|
compile-fail ./raw_pyobject_fail1.cpp : $(PYTHON_PROPERTIES) ;
|
|
compile-fail ./raw_pyobject_fail2.cpp : $(PYTHON_PROPERTIES) ;
|
|
compile-fail ./as_to_python_function.cpp : $(PYTHON_PROPERTIES) ;
|
|
compile-fail ./object_fail1.cpp : $(PYTHON_PROPERTIES) ;
|
|
|
|
|