-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
44 lines (35 loc) · 1.51 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
sudo: required
dist: trusty
language: cpp
env:
matrix:
- QT_VERSION=56 QT_PATCH=3
- QT_VERSION=59 QT_PATCH=3
addons:
apt:
sources:
- ubuntu-toolchain-r-test
before_install:
- sudo add-apt-repository -y ppa:beineri/opt-qt${QT_VERSION}${QT_PATCH}-trusty
- sudo apt-get update
install:
- sudo apt-get install -y -qq qt${QT_VERSION}base
before_script:
- source /opt/qt$QT_VERSION/bin/qt${QT_VERSION}-env.sh;
- g++ --version
script:
# Build
- cmake . -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
- make -j2
- sudo cp src/moc `which moc`
# Run local tests for moc-ng as a drop-in replacement
- mkdir test_build && cd test_build
- qmake ../tests QMAKE_MOC_OPTIONS="-D__artificial__=__unused__ -Wno-attributes -Wno-ambiguous-ellipsis -I/opt/qt$QT_VERSION/include -I/opt/qt$QT_VERSION/include/QtCore"
- make check
- cd ..
# Run local tests for moc-ng as a plugin
- git ls-files | xargs sed -i 's|Q_OBJECT|/* qmake ignore Q_OBJECT */ Q_OBJECT|;s|Q_GADGET|/* qmake ignore Q_GADGET */ Q_GADGET|;s|Q_NAMESPACE|/* qmake ignore Q_NAMESPACE */ Q_NAMESPACE|;/^#include "moc_/d;/^#include ".*\.moc"$/d'
- mkdir test_plugin && cd test_plugin
- qmake ../tests QMAKE_CXX=clang++ "QMAKE_CXXFLAGS=-Xclang -load -Xclang $PWD/../src/libmocng_plugin.so -Xclang -add-plugin -Xclang moc" CONFIG+=no_moc
- make check
# Ideally we would need to run the full Qt CI with moc-ng, but that's a bit much for travis.