Skip to content

Commit 2663e73

Browse files
committed
Automatically add library-path values to RUN_PATH/RUN_LD_LIBRARY_PATH
[SVN r17562]
1 parent 1f9d0bb commit 2663e73

4 files changed

Lines changed: 46 additions & 5 deletions

File tree

src/object/enum.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,13 @@ namespace
148148
dict d;
149149
d["__slots__"] = tuple();
150150
d["values"] = dict();
151-
151+
152+
object module_name = module_prefix();
153+
if (module_name)
154+
module_name += '.';
155+
152156
object result = (object(metatype))(
153-
module_prefix() + name, make_tuple(base), d);
157+
module_name + name, make_tuple(base), d);
154158

155159
scope().attr(name) = result;
156160

test/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ run result.cpp ;
153153
compile string_literal.cpp ;
154154
compile borrowed.cpp : $(UNIT_TEST_PROPERTIES) ;
155155
compile object_manager.cpp : $(UNIT_TEST_PROPERTIES) ;
156+
compile copy_ctor_mutates_rhs.cpp : $(UNIT_TEST_PROPERTIES) ;
156157

157158
run upcast.cpp <lib>../../test/build/boost_test_exec_monitor
158159
: # command-line args

test/auto_ptr.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <boost/python/class.hpp>
99
#include <boost/python/extract.hpp>
1010
#include <boost/python/def.hpp>
11+
#include <boost/python/implicit.hpp>
1112
#include "test_class.hpp"
1213

1314
#include <memory>
@@ -16,6 +17,11 @@ using namespace boost::python;
1617

1718
typedef test_class<> X;
1819

20+
struct Y : X
21+
{
22+
Y(int n) : X(n) {};
23+
};
24+
1925
int look(std::auto_ptr<X> const& x)
2026
{
2127
return (x.get()) ? x->value() : -1;
@@ -60,6 +66,10 @@ BOOST_PYTHON_MODULE(auto_ptr_ext)
6066
.def("value", &X::value)
6167
;
6268

69+
class_<Y, std::auto_ptr<Y>, bases<X>, boost::noncopyable>("X", init<int>())
70+
;
71+
72+
implicitly_convertible<std::auto_ptr<Y>, std::auto_ptr<X> >();
6373
def("look", look);
6474
def("steal", steal);
6575
def("maybe_steal", maybe_steal);

test/auto_ptr.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
>>> x = X(42)
44
>>> x.value()
55
42
6-
76
>>> look(x), look(x)
87
(42, 42)
98
@@ -32,12 +31,39 @@
3231
>>> look(x)
3332
77
3433
35-
>>> y = callback(lambda y: y)
36-
>>> y.value()
34+
>>> z = callback(lambda z: z)
35+
>>> z.value()
3736
77
3837
3938
>>> extract(x).value()
4039
77
40+
41+
#
42+
# Test derived to base conversions
43+
#
44+
45+
>>> y = Y(42)
46+
>>> y.value()
47+
42
48+
49+
>>> maybe_steal(y, 0)
50+
42
51+
52+
>>> try: maybe_steal(y, 0)
53+
... except TypeError: pass
54+
... else: print 'expected a TypeError exception'
55+
56+
>>> y.value()
57+
42
58+
59+
>>> steal(y)
60+
42
61+
62+
>>> if not '--broken-auto-ptr' in sys.argv:
63+
... try: y.value()
64+
... except TypeError: pass
65+
... else: print 'expected a TypeError exception'
66+
4167
'''
4268

4369
def run(args = None):

0 commit comments

Comments
 (0)