forked from CastXML/pygccxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
212 lines (191 loc) · 6.85 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
language:
- python
env:
global:
- WINDOWS=0
matrix:
include:
- os: linux
python: 3.5
env: WINDOWS=1
- os: linux
python: 2.6
env: XML_GENERATOR="gccxml"
- os: linux
python: 2.7
env: XML_GENERATOR="gccxml"
- os: linux
python: 3.2
env: XML_GENERATOR="gccxml"
- os: linux
python: 3.3
env: XML_GENERATOR="gccxml"
- os: linux
python: 3.4
env: XML_GENERATOR="gccxml"
- os: linux
python: 3.5
env: XML_GENERATOR="gccxml"
- os: linux
python: 2.7
env: XML_GENERATOR="castxml"
- os: linux
python: 3.5
env: XML_GENERATOR="castxml"
- os: linux
python: 3.5
env:
- XML_GENERATOR="castxml"
- COMPILER=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# gcc 5.2.1
- g++-5
- os: linux
dist: trusty
sudo: required
python: 3.5
env: XML_GENERATOR="castxml"
- os: linux
dist: trusty
sudo: required
python: 3.5
env:
# gcc 4.8.2 with c++03
- XML_GENERATOR="castxml"
- CPPSTD="-std=c++03"
- os: linux
dist: trusty
sudo: required
python: 3.5
env:
# gcc 4.8.2 with c++11
- XML_GENERATOR="castxml"
- CPPSTD="-std=c++11"
- os: linux
dist: trusty
sudo: required
python: 3.5
env:
- XML_GENERATOR="castxml"
- COMPILER=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# gcc 5.3.0
- g++-5
- os: linux
dist: trusty
sudo: required
python: 3.5
env:
- XML_GENERATOR="castxml"
- COMPILER=g++-5
- CPPSTD="-std=c++14"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# gcc 5.3.0
- g++-5
- os: osx
osx_image: xcode7.3
language: generic
env:
- XML_GENERATOR="castxml"
- TRAVIS_PYTHON_VERSION="2"
- os: osx
osx_image: xcode7.3
language: generic
env:
- XML_GENERATOR="castxml"
- TRAVIS_PYTHON_VERSION="3"
before_install:
# OS X
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then travis_retry brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then brew install python3; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/pip3 /usr/local/bin/pip; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then sudo ln -sf /usr/local/bin/python3 /usr/local/bin/python; fi
# Download castxml binaries
# To update the URLs, get the full URLS from ITK, and the run wget with --verbose on the URL.
# Look at the redirection and extract the direct URL for usage with Travis.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ ! -e ${HOME}/castxml ]; then
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461589/castxml-macosx.tar.gz | tar zxf - -C ${HOME};
fi;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
if [ ! -e ${HOME}/castxml ]; then
wget -q -O - https://midas3.kitware.com/midas/download/bitstream/461590/castxml-linux.tar.gz | tar zxf - -C ${HOME};
fi;
fi
# Add the castxml binary to the path
- if [[ $XML_GENERATOR == "castxml" ]]; then
export PATH=$PATH:~/castxml/bin/;
fi
# Setup gccxml for the gccxml builds on linux
- if [[ "$XML_GENERATOR" == "gccxml" ]]; then sudo apt-get update -qq; fi
- if [[ "$XML_GENERATOR" == "gccxml" ]]; then sudo apt-get install -qq gccxml; fi
# Patch the c++ version to test on the fly
- if [[ $CPPSTD == "-std=c++03" ]]; then
mv unittests/configs/travis_std03.cfg unittests/xml_generator.cfg;
fi
# Patch the c++ version to test on the fly
- if [[ $CPPSTD == "-std=c++11" ]]; then
mv unittests/configs/travis_std11.cfg unittests/xml_generator.cfg;
fi
# Patch the c++ version to test on the fly
- if [[ $CPPSTD == "-std=c++14" ]]; then
mv unittests/configs/travis_std14.cfg unittests/xml_generator.cfg;
fi
# Patch the compiler path on the fly for gcc5 testing
- if [[ "$COMPILER" == "g++-5" ]] && [[ $XML_GENERATOR == "castxml" ]]; then
mv unittests/configs/travis_gcc5.cfg unittests/xml_generator.cfg;
fi
- pip install coveralls
# Install coverage tools (On 3.2 the new coverage is broken, use an old one)
# https://github.com/menegazzo/travispy/issues/20
- if [[ $TRAVIS_PYTHON_VERSION == 3.2 ]] && [[ $WINDOWS == 0 ]]; then pip install 'coverage<4.0'; fi
- if [[ $TRAVIS_PYTHON_VERSION != 3.2 ]] && [[ $WINDOWS == 0 ]]; then pip install coverage; fi
# appveyor-artifacts will be used to fetch coverage results from appveyor
- if [ $WINDOWS == 0 ]; then
pip install pycodestyle;
else
pip install appveyor-artifacts;
fi
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install unittest2; fi
script:
- echo $TRAVIS_OS_NAME
- echo $WINDOWS
# Modify sitecustomize.py file for coverage. Allows to cover files run in a subprocess.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then touch "/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib/python${TRAVIS_PYTHON_VERSION}/sitecustomize.py"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 2 ]]; then touch "/usr/local/lib/python2.7/site-packages/sitecustomize.py"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]]; then touch "/usr/local/lib/python3.6/site-packages/sitecustomize.py"; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]];
then printf "import coverage\ncoverage.process_startup()\n" > "/home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/lib/python${TRAVIS_PYTHON_VERSION}/sitecustomize.py"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 2 ]];
then printf "import coverage\ncoverage.process_startup()\n" > "/usr/local/lib/python2.7/site-packages/sitecustomize.py"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ $TRAVIS_PYTHON_VERSION == 3 ]];
then printf "import coverage\ncoverage.process_startup()\n" > "/usr/local/lib/python3.6/site-packages/sitecustomize.py"; fi
# Install pygccxml, run the tests with coverage and
# combine multiple .coverage files
# We have multiple coverage files because some scripts run in a subprocess
- if [ $WINDOWS == 0 ]; then
python setup.py install;
coverage run unittests/test_all.py;
coverage combine;
fi
after_success:
# Send coverage result to https://coveralls.io/r/gccxml/pygccxml
# For the "empty" windows build, fetch the coverage results from appveyor
- if [ $WINDOWS == 1 ]; then
appveyor-artifacts -m --owner-name=iMichka --verbose download;
fi
- coveralls