diff --git a/test/Jamfile b/test/Jamfile index 854dc3f4..adacc831 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -67,6 +67,10 @@ run ../test/embedding.cpp ../build/boost_python <$(gcc-compilers)><*>$(CYGWIN_PYTHON_DLL_PATH) $(PYTHON_EMBEDDED_LIBRARY) ; +bpl-test crossmod_exception + : crossmod_exception.py crossmod_exception_a.cpp crossmod_exception_b.cpp + ; + bpl-test return_arg ; bpl-test staticmethod ; bpl-test shared_ptr ; diff --git a/test/crossmod_exception.py b/test/crossmod_exception.py new file mode 100644 index 00000000..75bed6ba --- /dev/null +++ b/test/crossmod_exception.py @@ -0,0 +1,20 @@ +# Copyright (C) 2003 Rational Discovery LLC +# Permission to copy, use, modify, sell and distribute this software +# is granted provided this copyright notice appears in all +# copies. This software is provided "as is" without express or +# implied warranty, and with no claim as to its suitability for any +# purpose. +import crossmod_exception_a +import crossmod_exception_b + +try: + crossmod_exception_b.tossit() +except IndexError: + pass +try: + crossmod_exception_a.tossit() +except IndexError: + pass + + + diff --git a/test/crossmod_exception_a.cpp b/test/crossmod_exception_a.cpp new file mode 100755 index 00000000..c39c41a9 --- /dev/null +++ b/test/crossmod_exception_a.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2003 Rational Discovery LLC +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all +// copies. This software is provided "as is" without express or +// implied warranty, and with no claim as to its suitability for any +// purpose. + +#include + +namespace python = boost::python; + +void tossit(){ + PyErr_SetString(PyExc_IndexError,"a-blah!"); + throw python::error_already_set(); +} + +BOOST_PYTHON_MODULE(crossmod_exception_a) +{ + python::def("tossit",tossit); +} diff --git a/test/crossmod_exception_b.cpp b/test/crossmod_exception_b.cpp new file mode 100755 index 00000000..17c88617 --- /dev/null +++ b/test/crossmod_exception_b.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2003 Rational Discovery LLC +// Permission to copy, use, modify, sell and distribute this software +// is granted provided this copyright notice appears in all +// copies. This software is provided "as is" without express or +// implied warranty, and with no claim as to its suitability for any +// purpose. + +#include + +namespace python = boost::python; + +void tossit(){ + PyErr_SetString(PyExc_IndexError,"b-blah!"); + throw python::error_already_set(); +} + +BOOST_PYTHON_MODULE(crossmod_exception_b) +{ + python::def("tossit",tossit); +}