Skip to content

Commit 5fbba7b

Browse files
committed
initial checkin
[SVN r13470]
1 parent 4cf7ab3 commit 5fbba7b

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

test/bienstman5.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright David Abrahams 2002. Permission to copy, use,
2+
// modify, sell and distribute this software is granted provided this
3+
// copyright notice appears in all copies. This software is provided
4+
// "as is" without express or implied warranty, and with no claim as
5+
// to its suitability for any purpose.
6+
7+
#include <boost/python/module.hpp>
8+
#include <boost/python/class.hpp>
9+
#include <boost/mpl/type_list.hpp>
10+
11+
#include <complex>
12+
13+
struct M {M(const std::complex<double>&) {} };
14+
15+
BOOST_PYTHON_MODULE_INIT(bienstman5_ext)
16+
{
17+
using namespace boost::python;
18+
using boost::mpl::type_list;
19+
20+
module m("bienstman5_ext");
21+
22+
m
23+
.add(class_<M>("M")
24+
.def_init(args<std::complex<double> const&>()))
25+
;
26+
27+
}
28+
29+

test/bienstman5.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'''
2+
>>> from bienstman5_ext import *
3+
>>> m = M(1j)
4+
'''
5+
def run(args = None):
6+
import sys
7+
import doctest
8+
9+
if args is not None:
10+
sys.argv = args
11+
return doctest.testmod(sys.modules.get(__name__))
12+
13+
if __name__ == '__main__':
14+
print "running..."
15+
import sys
16+
sys.exit(run()[0])

0 commit comments

Comments
 (0)