Skip to content

Commit f0d5bef

Browse files
committed
Merge branch 'develop' of https://github.com/boostorg/python into develop
2 parents e820537 + c2d144a commit f0d5bef

File tree

16 files changed

+148
-106
lines changed

16 files changed

+148
-106
lines changed

.travis.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,32 @@
1010
language: cpp
1111

1212
env:
13-
- PYTHON=python
14-
- PYTHON=python3
13+
- PYTHON=python CCFLAGS=-std=c++98
14+
- PYTHON=python CCFLAGS=-std=c++11
15+
- PYTHON=python3 CCFLAGS=-std=c++98
16+
- PYTHON=python3 CCFLAGS=-std=c++11
1517

1618
compiler:
17-
- gcc
19+
- gcc
1820

21+
22+
addons:
23+
apt:
24+
sources:
25+
- ubuntu-toolchain-r-test
26+
packages:
27+
- gcc-4.8
28+
- g++-4.8
29+
- clang
30+
- python-dev python-pip
31+
- python3-dev
32+
- libboost-all-dev
33+
1934
before_install:
20-
- sudo apt-get install -y python-dev python-pip
2135
- sudo pip install future
22-
- sudo apt-get install -y python3-dev
23-
- sudo apt-get install -y libboost-all-dev
36+
37+
install:
38+
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
2439

2540
script: scons config --python=$PYTHON && scons && scons test
2641

config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def prepare_build_dir(env):
9292

9393
def variants(env):
9494

95-
env.Append(CPPPATH = "#/include", CPPDEFINES = ["BOOST_ALL_NO_LIB=1"])
95+
env.Prepend(CPPPATH = "#/include", CPPDEFINES = ["BOOST_ALL_NO_LIB=1"])
9696
set_property(env, architecture = env['TARGET_ARCH'])
9797
for variant in env["variant"]:
9898
e = env.Clone()

config/tools/tests.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,25 @@
1111
from SCons.Action import Action
1212
from subprocess import check_output, STDOUT, CalledProcessError
1313
import sys
14+
import os
1415

1516

1617
def BoostCompileTest(env, test, source = None, **kw):
18+
19+
def gen_result(target, source, env=env):
20+
target_file = target[0].abspath
21+
result_file = os.path.splitext(target_file)[0] + '.result'
22+
if sys.stdout.isatty():
23+
env['RESULT']='\033[92mPASS\033[0m'
24+
else:
25+
env['RESULT']='PASS'
26+
27+
with open(result_file, 'w+') as result:
28+
result.write('Result: {}\n'.format('pass'))
29+
1730
obj = env.Object(test, source if source is not None else test + '.cpp')
31+
env.AddPostAction(obj, Action(gen_result, cmdstr=None))
32+
env.AddPostAction(obj, Action('@echo $RESULT'))
1833
return obj
1934

2035
def BoostRun(env, prog, target, command = '$SOURCE'):
@@ -77,8 +92,11 @@ def print_summary(target, source, **kw):
7792
failures = [r for r in results
7893
if r.get_path().endswith('.result') and not 'Result: pass' in r.get_contents()]
7994
print('%s tests; %s pass; %s fails'%(len(results), len(results)-len(failures), len(failures)))
95+
if failures:
96+
print('For detailed failure reports, see:')
8097
for f in failures:
81-
print('%s\n%s'%(f.get_path(), f.get_contents()))
98+
print(f.get_path())
99+
82100
testsumcomstr = env.get('TESTSUMCOMSTR')
83101
if testsumcomstr:
84102
run = env.Command('summary', tests, Action(print_summary, cmdstr=testsumcomstr))

include/boost/python/cast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace detail
7070
template <class T>
7171
inline void assert_castable(boost::type<T>* = 0)
7272
{
73-
typedef char must_be_a_complete_type[sizeof(T)];
73+
typedef char must_be_a_complete_type[sizeof(T)] BOOST_ATTRIBUTE_UNUSED;
7474
}
7575

7676
template <class Source, class Target>

include/boost/python/class.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ namespace detail
140140
// https://svn.boost.org/trac/boost/ticket/5803
141141
//typedef typename assertion<mpl::not_<is_same<Default,Fn> > >::failed test0;
142142
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
143-
typedef typename assertion<is_polymorphic<T> >::failed test1;
143+
typedef typename assertion<is_polymorphic<T> >::failed test1 BOOST_ATTRIBUTE_UNUSED;
144144
# endif
145-
typedef typename assertion<is_member_function_pointer<Fn> >::failed test2;
145+
typedef typename assertion<is_member_function_pointer<Fn> >::failed test2 BOOST_ATTRIBUTE_UNUSED;
146146
not_a_derived_class_member<Default>(Fn());
147147
}
148148
};

include/boost/python/def.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace detail
3737
// Must not try to use default implementations except with method definitions.
3838
typedef typename error::multiple_functions_passed_to_def<
3939
Helper::has_default_implementation
40-
>::type assertion;
40+
>::type assertion BOOST_ATTRIBUTE_UNUSED;
4141

4242
detail::scope_setattr_doc(
4343
name, boost::python::make_function(

include/boost/python/detail/config.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,8 @@
135135
#define BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition
136136
#endif
137137

138+
#if !defined(BOOST_ATTRIBUTE_UNUSED) && defined(__GNUC__) && (__GNUC__ >= 4)
139+
# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused))
140+
#endif
141+
138142
#endif // CONFIG_DWA052200_H_

include/boost/python/detail/defaults_gen.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ namespace detail
213213
{ \
214214
typedef typename ::boost::python::detail:: \
215215
error::more_keywords_than_function_arguments< \
216-
N,n_args>::too_many_keywords assertion; \
216+
N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \
217217
} \
218218
template <std::size_t N> \
219219
fstubs_name(::boost::python::detail::keywords<N> const& keywords, char const* doc = 0) \
@@ -222,7 +222,7 @@ namespace detail
222222
{ \
223223
typedef typename ::boost::python::detail:: \
224224
error::more_keywords_than_function_arguments< \
225-
N,n_args>::too_many_keywords assertion; \
225+
N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \
226226
}
227227

228228
# if defined(BOOST_NO_VOID_RETURNS)

include/boost/python/init.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace detail
6868
template <int keywords, int init_args>
6969
struct more_keywords_than_init_arguments
7070
{
71-
typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1];
71+
typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1] BOOST_ATTRIBUTE_UNUSED;
7272
};
7373
}
7474

@@ -224,7 +224,7 @@ class init : public init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> >
224224
{
225225
typedef typename detail::error::more_keywords_than_init_arguments<
226226
N, n_arguments::value + 1
227-
>::too_many_keywords assertion;
227+
>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED;
228228
}
229229

230230
template <std::size_t N>
@@ -233,7 +233,7 @@ class init : public init_base<init<BOOST_PYTHON_OVERLOAD_ARGS> >
233233
{
234234
typedef typename detail::error::more_keywords_than_init_arguments<
235235
N, n_arguments::value + 1
236-
>::too_many_keywords assertion;
236+
>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED;
237237
}
238238

239239
template <class CallPoliciesT>

include/boost/python/make_constructor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ namespace detail
174174

175175
typedef typename detail::error::more_keywords_than_function_arguments<
176176
NumKeywords::value, arity
177-
>::too_many_keywords assertion;
177+
>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED;
178178

179179
typedef typename outer_constructor_signature<Sig>::type outer_signature;
180180

0 commit comments

Comments
 (0)