1
1
language :
2
2
- python
3
3
4
+ env :
5
+ global :
6
+ - WINDOWS=0
7
+ - SITECUSTOMIZELIBPATH=0
8
+
4
9
matrix :
5
10
include :
11
+ - os : linux
12
+ python : 3.5
13
+ env : WINDOWS=1
6
14
- os : linux
7
15
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"
9
19
- os : linux
10
20
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"
12
24
- os : linux
13
25
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"
15
29
- os : linux
16
30
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"
18
34
- os : linux
19
35
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"
21
39
- os : linux
22
40
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"
24
44
- os : linux
25
45
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"
27
49
- os : linux
28
50
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"
30
69
- os : linux
31
70
python : 3.5
32
71
env :
33
72
- XML_GENERATOR="castxml"
34
73
- COMPILER=g++-5
74
+ - SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
35
75
addons :
36
76
apt :
37
77
sources :
@@ -43,7 +83,9 @@ matrix:
43
83
dist : trusty
44
84
sudo : required
45
85
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"
47
89
- os : linux
48
90
dist : trusty
49
91
sudo : required
@@ -52,6 +94,7 @@ matrix:
52
94
# gcc 4.8.2 with c++03
53
95
- XML_GENERATOR="castxml"
54
96
- CPPSTD="-std=c++03"
97
+ - SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
55
98
- os : linux
56
99
dist : trusty
57
100
sudo : required
@@ -60,13 +103,15 @@ matrix:
60
103
# gcc 4.8.2 with c++11
61
104
- XML_GENERATOR="castxml"
62
105
- CPPSTD="-std=c++11"
106
+ - SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
63
107
- os : linux
64
108
dist : trusty
65
109
sudo : required
66
110
python : 3.5
67
111
env :
68
112
- XML_GENERATOR="castxml"
69
113
- COMPILER=g++-5
114
+ - SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
70
115
addons :
71
116
apt :
72
117
sources :
@@ -82,6 +127,7 @@ matrix:
82
127
- XML_GENERATOR="castxml"
83
128
- COMPILER=g++-5
84
129
- CPPSTD="-std=c++14"
130
+ - SITECUSTOMIZELIBPATH="/home/travis/virtualenv/python3.5/lib/python3.5/sitecustomize.py"
85
131
addons :
86
132
apt :
87
133
sources :
@@ -95,12 +141,29 @@ matrix:
95
141
env :
96
142
- XML_GENERATOR="castxml"
97
143
- TRAVIS_PYTHON_VERSION="2"
144
+ - SITECUSTOMIZELIBPATH="/usr/local/lib/python2.7/site-packages/sitecustomize.py"
98
145
- os : osx
99
146
osx_image : xcode7.3
100
147
language : generic
101
148
env :
102
149
- XML_GENERATOR="castxml"
103
150
- 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"
104
167
105
168
106
169
before_install :
@@ -111,20 +174,28 @@ before_install:
111
174
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/python3 /usr/local/bin/python; fi
112
175
113
176
# 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.
114
179
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
115
180
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};
117
182
fi;
118
183
fi
119
184
120
185
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
121
186
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};
123
194
fi;
124
195
fi
125
196
126
197
# Add the castxml binary to the path
127
- - if [[ $XML_GENERATOR == "castxml" ]]; then
198
+ - if [[ $XML_GENERATOR == "castxml" ]] || [[ $XML_GENERATOR == "castxml-18032017" ]] ; then
128
199
export PATH=$PATH:~/castxml/bin/;
129
200
fi
130
201
@@ -134,61 +205,73 @@ before_install:
134
205
135
206
# Patch the c++ version to test on the fly
136
207
- 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 ;
138
209
fi
139
210
140
211
# Patch the c++ version to test on the fly
141
212
- 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 ;
143
214
fi
144
215
145
216
# Patch the c++ version to test on the fly
146
217
- 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 ;
148
219
fi
149
220
150
221
# Patch the compiler path on the fly for gcc5 testing
151
222
- 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;
153
229
fi
154
230
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
157
236
158
237
# Install coverage tools (On 3.2 the new coverage is broken, use an old one)
159
238
# 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;
162
245
else
163
- pip install coverage ;
246
+ pip install https://github.com/Robpol86/appveyor-artifacts/archive/master.zip ;
164
247
fi
165
- - pip install coveralls
166
248
167
249
install :
168
250
- if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install unittest2; fi
169
251
170
252
script :
171
253
- echo $TRAVIS_OS_NAME
254
+ - echo $WINDOWS
255
+ - python --version
172
256
173
257
# 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
192
275
193
276
after_success :
194
277
# Send coverage result to https://coveralls.io/r/gccxml/pygccxml
0 commit comments