mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
Added cross-module exception test
[SVN r19282]
This commit is contained in:
@@ -67,6 +67,10 @@ run ../test/embedding.cpp <lib>../build/boost_python
|
||||
<$(gcc-compilers)><*><library-path>$(CYGWIN_PYTHON_DLL_PATH)
|
||||
<find-library>$(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 ;
|
||||
|
||||
20
test/crossmod_exception.py
Normal file
20
test/crossmod_exception.py
Normal file
@@ -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
|
||||
|
||||
|
||||
|
||||
20
test/crossmod_exception_a.cpp
Executable file
20
test/crossmod_exception_a.cpp
Executable file
@@ -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 <boost/python.hpp>
|
||||
|
||||
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);
|
||||
}
|
||||
20
test/crossmod_exception_b.cpp
Executable file
20
test/crossmod_exception_b.cpp
Executable file
@@ -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 <boost/python.hpp>
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user