Skip to content

Commit c1b521e

Browse files
committed
Merge branch 'develop'
2 parents 1384ff8 + 3540e71 commit c1b521e

File tree

274 files changed

+4573
-4445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+4573
-4445
lines changed

.coveragerc

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
source = pygccxml,docs/examples,unittests
33
# unittest/misc contains some tests that are just there for debugging
44
# purposes and which do not need to be covered.
5-
omit = unittests/misc
5+
omit = unittests/misc,unittests/demangled_tester.py
66
parallel = True
77

88
[report]
@@ -22,3 +22,6 @@ exclude_lines =
2222
# Don't complain if non-runnable code isn't run:
2323
if 0:
2424
if __name__ == .__main__.:
25+
26+
# Unittests runner
27+
unittest.TextTestRunner\(

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ docs/_build
55
unittests/temp
66
unittests/data/pygccxml.cache
77
unittests/data/directory_cache_test
8+
unittests/data/ogre.1.7.xml
89
.idea
910
dist
1011
build
@@ -14,3 +15,4 @@ pygccxml.egg-info
1415
docs/examples/caching/example.hpp.xml
1516
test_cost.log
1617
docs/apidocs
18+
htmlcov

.travis.yml

+123-40
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,77 @@
11
language:
22
- python
33

4+
env:
5+
global:
6+
- WINDOWS=0
7+
- SITECUSTOMIZELIBPATH=0
8+
49
matrix:
510
include:
11+
- os: linux
12+
python: 3.5
13+
env: WINDOWS=1
614
- os: linux
715
python: 2.6
8-
env: XML_GENERATOR="gccxml"
16+
env:
17+
- XML_GENERATOR="gccxml"
18+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python2.6/lib/python2.6/sitecustomize.py"
919
- os: linux
1020
python: 2.7
11-
env: XML_GENERATOR="gccxml"
21+
env:
22+
- XML_GENERATOR="gccxml"
23+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python2.7/lib/python2.7/sitecustomize.py"
1224
- os: linux
1325
python: 3.2
14-
env: XML_GENERATOR="gccxml"
26+
env:
27+
- XML_GENERATOR="gccxml"
28+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.2/lib/python3.2/sitecustomize.py"
1529
- os: linux
1630
python: 3.3
17-
env: XML_GENERATOR="gccxml"
31+
env:
32+
- XML_GENERATOR="gccxml"
33+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.3/lib/python3.3/sitecustomize.py"
1834
- os: linux
1935
python: 3.4
20-
env: XML_GENERATOR="gccxml"
36+
env:
37+
- XML_GENERATOR="gccxml"
38+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.4/lib/python3.4/sitecustomize.py"
2139
- os: linux
2240
python: 3.5
23-
env: XML_GENERATOR="gccxml"
41+
env:
42+
- XML_GENERATOR="gccxml"
43+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
2444
- os: linux
2545
python: 2.7
26-
env: XML_GENERATOR="castxml"
46+
env:
47+
- XML_GENERATOR="castxml"
48+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python2.7/lib/python2.7/sitecustomize.py"
2749
- os: linux
2850
python: 3.5
29-
env: XML_GENERATOR="castxml"
51+
env:
52+
- XML_GENERATOR="castxml"
53+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
54+
- os: linux
55+
python: 3.6
56+
env:
57+
- XML_GENERATOR="castxml"
58+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.6/lib/python3.6/sitecustomize.py"
59+
- os: linux
60+
python: "pypy"
61+
env:
62+
- XML_GENERATOR="castxml"
63+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/pypy/lib-python/2.7/sitecustomize.py"
64+
- os: linux
65+
python: "pypy3.3-5.2-alpha1"
66+
env:
67+
- XML_GENERATOR="castxml"
68+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/pypy3/lib-python/3/sitecustomize.py"
3069
- os: linux
3170
python: 3.5
3271
env:
3372
- XML_GENERATOR="castxml"
3473
- COMPILER=g++-5
74+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
3575
addons:
3676
apt:
3777
sources:
@@ -43,7 +83,9 @@ matrix:
4383
dist: trusty
4484
sudo: required
4585
python: 3.5
46-
env: XML_GENERATOR="castxml"
86+
env:
87+
- XML_GENERATOR="castxml"
88+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
4789
- os: linux
4890
dist: trusty
4991
sudo: required
@@ -52,6 +94,7 @@ matrix:
5294
# gcc 4.8.2 with c++03
5395
- XML_GENERATOR="castxml"
5496
- CPPSTD="-std=c++03"
97+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
5598
- os: linux
5699
dist: trusty
57100
sudo: required
@@ -60,13 +103,15 @@ matrix:
60103
# gcc 4.8.2 with c++11
61104
- XML_GENERATOR="castxml"
62105
- CPPSTD="-std=c++11"
106+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
63107
- os: linux
64108
dist: trusty
65109
sudo: required
66110
python: 3.5
67111
env:
68112
- XML_GENERATOR="castxml"
69113
- COMPILER=g++-5
114+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
70115
addons:
71116
apt:
72117
sources:
@@ -82,6 +127,7 @@ matrix:
82127
- XML_GENERATOR="castxml"
83128
- COMPILER=g++-5
84129
- CPPSTD="-std=c++14"
130+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
85131
addons:
86132
apt:
87133
sources:
@@ -95,12 +141,29 @@ matrix:
95141
env:
96142
- XML_GENERATOR="castxml"
97143
- TRAVIS_PYTHON_VERSION="2"
144+
- SITECUSTOMIZELIBPATH="/usr/local/lib/python2.7/site-packages/sitecustomize.py"
98145
- os: osx
99146
osx_image: xcode7.3
100147
language: generic
101148
env:
102149
- XML_GENERATOR="castxml"
103150
- TRAVIS_PYTHON_VERSION="3"
151+
- SITECUSTOMIZELIBPATH="/usr/local/lib/python3.6/site-packages/sitecustomize.py"
152+
- os: linux
153+
dist: trusty
154+
sudo: required
155+
python: 3.5
156+
env:
157+
- XML_GENERATOR="castxml-18032017"
158+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
159+
- os: linux
160+
dist: trusty
161+
sudo: required
162+
python: 3.5
163+
env:
164+
- XML_GENERATOR="castxml-18032017"
165+
- CASTXML_EPIC="1"
166+
- SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
104167

105168

106169
before_install:
@@ -111,20 +174,28 @@ before_install:
111174
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/python3 /usr/local/bin/python; fi
112175

113176
# Download castxml binaries
177+
# To update the URLs, get the full URLS from ITK, and the run wget with --verbose on the URL.
178+
# Look at the redirection and extract the direct URL for usage with Travis.
114179
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
115180
if [ ! -e ${HOME}/castxml ]; then
116-
wget -O - https://midas3.kitware.com/midas/download/bitstream/460403/castxml-macosx.tar.gz | tar zxf - -C ${HOME};
181+
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461589/castxml-macosx.tar.gz | tar zxf - -C ${HOME};
117182
fi;
118183
fi
119184

120185
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
121186
if [ ! -e ${HOME}/castxml ]; then
122-
wget -O - https://midas3.kitware.com/midas/download/bitstream/460468/castxml-linux.tar.gz | tar zxf - -C ${HOME};
187+
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461590/castxml-linux.tar.gz | tar zxf - -C ${HOME};
188+
fi;
189+
fi
190+
191+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml-18032017" ]]; then
192+
if [ ! -e ${HOME}/castxml ]; then
193+
wget -q -O - https://sourceforge.net/projects/pygccxml-castxml-binaries/files/castxml-linux-18032017.tar.gz | tar zxf - -C ${HOME};
123194
fi;
124195
fi
125196

126197
# Add the castxml binary to the path
127-
- if [[ $XML_GENERATOR == "castxml" ]]; then
198+
- if [[ $XML_GENERATOR == "castxml" ]] || [[ $XML_GENERATOR == "castxml-18032017" ]]; then
128199
export PATH=$PATH:~/castxml/bin/;
129200
fi
130201

@@ -134,61 +205,73 @@ before_install:
134205

135206
# Patch the c++ version to test on the fly
136207
- if [[ $CPPSTD == "-std=c++03" ]]; then
137-
cd unittests && sed -i s%compiler=None,%compiler=None,\\n\ \ \ \ \ \ \ \ cflags=\"-std=c++03\",%g autoconfig.py && cd ..;
208+
mv unittests/configs/travis_std03.cfg unittests/xml_generator.cfg;
138209
fi
139210

140211
# Patch the c++ version to test on the fly
141212
- if [[ $CPPSTD == "-std=c++11" ]]; then
142-
cd unittests && sed -i s%compiler=None,%compiler=None,\\n\ \ \ \ \ \ \ \ cflags=\"-std=c++11\",%g autoconfig.py && cd ..;
213+
mv unittests/configs/travis_std11.cfg unittests/xml_generator.cfg;
143214
fi
144215

145216
# Patch the c++ version to test on the fly
146217
- if [[ $CPPSTD == "-std=c++14" ]]; then
147-
cd unittests && sed -i s%compiler=None,%compiler=None,\\n\ \ \ \ \ \ \ \ cflags=\"-std=c++14\",%g autoconfig.py && cd ..;
218+
mv unittests/configs/travis_std14.cfg unittests/xml_generator.cfg;
148219
fi
149220

150221
# Patch the compiler path on the fly for gcc5 testing
151222
- if [[ "$COMPILER" == "g++-5" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
152-
cd unittests && sed -i s%compiler=None%compiler=\"/usr/bin/g++-5\"%g autoconfig.py && cd ..;
223+
mv unittests/configs/travis_gcc5.cfg unittests/xml_generator.cfg;
224+
fi
225+
226+
# Patch the c++ version to test on the fly
227+
- if [[ $CASTXML_EPIC == "1" ]]; then
228+
mv unittests/configs/castxml_epic1.cfg unittests/xml_generator.cfg;
153229
fi
154230

155-
# Install pep8, needed by the unit tests
156-
- pip install pep8
231+
# The setuptools version installed on travis is too new and will
232+
# not work with python 3.2
233+
- if [[ $TRAVIS_PYTHON_VERSION == 3.2 ]] && [[ $WINDOWS == 0 ]]; then pip install 'setuptools<30.0.0'; fi
234+
235+
- pip install coveralls
157236

158237
# Install coverage tools (On 3.2 the new coverage is broken, use an old one)
159238
# https://github.com/menegazzo/travispy/issues/20
160-
- if [ $TRAVIS_PYTHON_VERSION == 3.2 ]; then
161-
pip install 'coverage<4.0';
239+
- if [[ $TRAVIS_PYTHON_VERSION == 3.2 ]] && [[ $WINDOWS == 0 ]]; then pip install 'coverage<4.0'; fi
240+
- if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]] && [[ $WINDOWS == 0 ]]; then pip install coverage; fi
241+
242+
# appveyor-artifacts will be used to fetch coverage results from appveyor
243+
- if [ $WINDOWS == 0 ]; then
244+
pip install pycodestyle;
162245
else
163-
pip install coverage;
246+
pip install https://github.com/Robpol86/appveyor-artifacts/archive/master.zip;
164247
fi
165-
- pip install coveralls
166248

167249
install:
168250
- if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install unittest2; fi
169251

170252
script:
171253
- echo $TRAVIS_OS_NAME
254+
- echo $WINDOWS
255+
- python --version
172256

173257
# Modify sitecustomize.py file for coverage. Allows to cover files run in a subprocess.
174-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then touch "/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib/python${TRAVIS_PYTHON_VERSION}/sitecustomize.py"; fi
175-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 2 ]]; then touch "/usr/local/lib/python2.7/site-packages/sitecustomize.py"; fi
176-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then touch "/usr/local/lib/python3.6/site-packages/sitecustomize.py"; fi
177-
178-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]];
179-
then printf "import coverage\ncoverage.process_startup()\n" > "/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib/python${TRAVIS_PYTHON_VERSION}/sitecustomize.py"; fi
180-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 2 ]];
181-
then printf "import coverage\ncoverage.process_startup()\n" > "/usr/local/lib/python2.7/site-packages/sitecustomize.py"; fi
182-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]];
183-
then printf "import coverage\ncoverage.process_startup()\n" > "/usr/local/lib/python3.6/site-packages/sitecustomize.py"; fi
184-
185-
# Install pygccxml
186-
- python setup.py install
187-
188-
# Run the tests with coverage
189-
- coverage run unittests/test_all.py
190-
# Combine multiple .coverage files (we have multiple files because some scripts were run in a subprocess).
191-
- coverage combine
258+
- if [ $WINDOWS == 0 ]; then
259+
touch ${SITECUSTOMIZELIBPATH} || travis_terminate 1;
260+
printf "import coverage\ncoverage.process_startup()\n" > ${SITECUSTOMIZELIBPATH} || travis_terminate 1;
261+
fi
262+
263+
# Install pygccxml, run the tests with coverage and
264+
# combine multiple .coverage files
265+
# We have multiple coverage files because some scripts run in a subprocess
266+
- if [ $WINDOWS == 0 ]; then
267+
python setup.py install || travis_terminate 1;
268+
coverage run -m unittests.test_all || travis_terminate 1;
269+
coverage combine || travis_terminate 1;
270+
fi
271+
# For the "empty" windows build, fetch the coverage results from appveyor
272+
- if [ $WINDOWS == 1 ]; then
273+
appveyor-artifacts -m --owner-name=iMichka --verbose download || travis_terminate 1;
274+
fi
192275

193276
after_success:
194277
# Send coverage result to https://coveralls.io/r/gccxml/pygccxml

0 commit comments

Comments
 (0)