forked from iamantony/qtcsv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
280 lines (268 loc) · 7.76 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
language: cpp
matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=48
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=48 USE_CMAKE=true
- os: osx
compiler: clang
env:
- QT_BASE=48
- os: osx
compiler: clang
env:
- QT_BASE=48 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=51
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=51 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=52
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=52 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=53
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=53 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=54
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=54 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=55
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=55 USE_CMAKE=true
# - os: osx
# compiler: clang
# env:
# - QT_BASE=55
- os: osx
compiler: clang
env:
- QT_BASE=55 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=56
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=56 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=57
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=57 USE_CMAKE=true
# - os: osx
# compiler: clang
# env:
# - QT_BASE=57
- os: osx
compiler: clang
env:
- QT_BASE=57 USE_CMAKE=true
# - os: linux
# dist: trusty
# sudo: required
# compiler: gcc
# env:
# - QT_BASE=58
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=58 USE_CMAKE=true
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=59
- os: linux
dist: trusty
sudo: required
compiler: gcc
env:
- QT_BASE=59 USE_CMAKE=true
- os: osx
compiler: clang
env:
- QT_BASE=59
# - os: osx
# compiler: clang
# env:
# - QT_BASE=59 USE_CMAKE=true
before_install:
- if [[ "$QT_BASE" = "48" && "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:beineri/opt-qt487-trusty -y; fi
- if [ "$QT_BASE" = "51" ]; then sudo add-apt-repository ppa:beineri/opt-qt511-trusty -y; fi
- if [ "$QT_BASE" = "52" ]; then sudo add-apt-repository ppa:beineri/opt-qt521-trusty -y; fi
- if [ "$QT_BASE" = "53" ]; then sudo add-apt-repository ppa:beineri/opt-qt532-trusty -y; fi
- if [ "$QT_BASE" = "54" ]; then sudo add-apt-repository ppa:beineri/opt-qt542-trusty -y; fi
- if [[ "$QT_BASE" = "55" && "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:beineri/opt-qt551-trusty -y; fi
- if [ "$QT_BASE" = "56" ]; then sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y; fi
- if [[ "$QT_BASE" = "57" && "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:beineri/opt-qt571-trusty -y; fi
- if [[ "$QT_BASE" = "58" && "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y; fi
- if [[ "$QT_BASE" = "59" && "$TRAVIS_OS_NAME" = "linux" ]]; then sudo add-apt-repository ppa:beineri/opt-qt591-trusty -y; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get update -qq;
else
brew update;
fi
install:
- if [ "$QT_BASE" = "48" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq opt-qt4-qmake opt-qt4-dev-tools; source /opt/qt-4.8/bin/qt-4.8-env.sh;
else
brew tap cartr/qt4;
brew tap-pin cartr/qt4;
brew install qt@4;
brew link --force qt@4;
fi
fi
- if [ "$QT_BASE" = "51" ]; then sudo apt-get install -qq qt51base; source /opt/qt51/bin/qt51-env.sh; fi
- if [ "$QT_BASE" = "52" ]; then sudo apt-get install -qq qt52base; source /opt/qt52/bin/qt52-env.sh; fi
- if [ "$QT_BASE" = "53" ]; then sudo apt-get install -qq qt53base; source /opt/qt53/bin/qt53-env.sh; fi
- if [ "$QT_BASE" = "54" ]; then sudo apt-get install -qq qt54base; source /opt/qt54/bin/qt54-env.sh; fi
- if [ "$QT_BASE" = "55" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq qt55base; source /opt/qt55/bin/qt55-env.sh;
else
brew install qt55;
brew link --force qt55;
export QT_NAME="[email protected]";
export HOMEBREW_QT5_VERSION=$(brew list --versions $QT_NAME | rev | cut -d' ' -f1 | rev);
ln -s /usr/local/Cellar/$QT_NAME/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs;
fi
fi
- if [ "$QT_BASE" = "56" ]; then sudo apt-get install -qq qt56base; source /opt/qt56/bin/qt56-env.sh; fi
- if [ "$QT_BASE" = "57" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq qt57base; source /opt/qt57/bin/qt57-env.sh;
else
brew install [email protected];
brew link --force [email protected];
export QT_NAME="[email protected]";
export HOMEBREW_QT5_VERSION=$(brew list --versions $QT_NAME | rev | cut -d' ' -f1 | rev);
ln -s /usr/local/Cellar/$QT_NAME/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs;
fi
fi
- if [ "$QT_BASE" = "58" ]; then sudo apt-get install -qq qt58base; source /opt/qt58/bin/qt58-env.sh; fi
- if [ "$QT_BASE" = "59" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -qq qt59base; source /opt/qt59/bin/qt59-env.sh;
else
brew install qt5;
brew link --force qt5;
export HOMEBREW_QT5_VERSION=$(brew list --versions qt5 | rev | cut -d' ' -f1 | rev);
ln -s /usr/local/Cellar/qt5/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs;
fi
fi
script:
# build library and tests, install library
- mkdir ./build && cd ./build
- if [ "$USE_CMAKE" = "true" ]; then
cmake --version;
if [ "$QT_BASE" = "48" ]; then
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_QT4=ON ..;
else
cmake -DCMAKE_BUILD_TYPE=Release ..;
fi
make;
sudo make install;
cd ./tests;
else
qmake -v;
qmake ../qtcsv.pro CONFIG+=release;
make;
sudo make install;
mkdir ./tests && cd ./tests;
qmake ../../tests/tests.pro CONFIG+=release LIBS+=-L../;
make;
fi
# download test file
- wget http://www.maxmind.com/download/worldcities/worldcitiespop.txt.gz
- gunzip worldcitiespop.txt.gz
- mv ./worldcitiespop.txt ./data
# run tests
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/../
- chmod 777 qtcsv_tests
- ./qtcsv_tests
# check if library was properly installed
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
echo "Check installation";
if [ -f /usr/local/lib/libqtcsv.so ]; then
ls -la /usr/local/lib | grep qtcsv;
else
echo "File '/usr/local/lib/libqtcsv.so' do not exist";
exit 1;
fi
if [ -d /usr/local/include/qtcsv ]; then
ls -la /usr/local/include/qtcsv;
else
echo "Dir '/usr/local/include/qtcsv' do not exist";
exit 1;
fi
fi
notifications:
email: false