-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.travis.yml
81 lines (73 loc) · 3.92 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
language: cpp
compiler:
- clang
- gcc
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "YlZmQnVY0FCZ0jwXlHB/vqdfSFgHRyGWZej6oEC9YQyhXSiiz4C2zEVW6RuHQT6OPWsehDsjNFBBJyGsJIX8xp1Z5Y2n8YhVPsv6fLFiz0AF5WrJXhycC4Gz174CqPT6vSTZ42KmSrXqPE6fpH1mZNSFBwXrTmhwWcjLlbWvnmo="
addons:
coverity_scan:
project:
name: "pcolby/libqtaws"
description: "Build submitted via Travis CI"
notification_email: [email protected]
build_command_prepend: >
cp -a "$TRAVIS_BUILD_DIR" "$TRAVIS_BUILD_DIR-scan" &&
pushd "$TRAVIS_BUILD_DIR-scan" &&
qmake -qt=qt5 -Wall -Wlogic -Wparser CONFIG+=debug_and_release
build_command: make -j2 all
branch_pattern: coverity
before_install:
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq cppcheck doxygen graphviz qt5-qmake qtbase5-dev
- sudo apt-get install -qq lcov rubygems
- gem install lcoveralls
install:
# Fetch Qt 5.1's QMessageAuthenticationCode class, and dependencies, for Qt 5.0 support.
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/3rdparty/rfc6234/sha-private.h
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/3rdparty/rfc6234/sha.h
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/3rdparty/rfc6234/sha224-256.c
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/3rdparty/rfc6234/sha384-512.c
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/corelib/tools/qmessageauthenticationcode.cpp
- wget -P src/core/ https://code.qt.io/cgit/qt/qtbase.git/plain/src/corelib/tools/qmessageauthenticationcode.h
# Fixup some includes / paths.
- sed -i -re 's/"qvarlengtharray.h"/<QVarLengthArray>/' -e 's:\.\./\.\./3rdparty/rfc6234/::' src/core/qmessageauthenticationcode.cpp
# No Sha3_* constants in Qt5.0
- sed -i -re 's:(^\s*)(.*Sha3_):\1//\2:' src/core/qmessageauthenticationcode.cpp
# Restore the rfc6234 code's original stdint types (Nokia commented them out).
- sed -i -re 's:^#define u?int://&:' src/core/qmessageauthenticationcode.cpp
- sed -i -re 's:^//\s*(#include <stdint.h>):\1:' src/core/sha.h
# Restore the addTemp and SHA*AddLength macros (Nokia commented out / renamed).
- sed -i -re 's:^/\*\s*(static.*addTemp;)\s*\*/:\1:' -e 's/(SHA224_256AddLength)M/\1/' src/core/sha224-256.c
- sed -i -re 's:^/\*\s*(static.*addTemp;)\s*\*/:\1:' -e 's/(SHA384_512AddLength)M/\1/' src/core/sha384-512.c
# Apply the QTBUG-32100 fixes for Qt 5.0 with Clang on Travis CI
- sudo patch -p0 /usr/include/qt5/QtCore/qabstractitemmodel.h .travis/qabstractitemmodel.diff
- sudo patch -p0 /usr/include/qt5/QtCore/qurl.h .travis/qurl.diff
- sudo patch -p0 /usr/include/qt5/QtNetwork/qhostaddress.h .travis/qhostaddress.diff
before_script:
- mkdir -p $TRAVIS_BUILD_DIR-build
- if [ "$CXX" = "clang++" ]; then export QMAKESPEC=linux-clang; fi
- pushd "$TRAVIS_BUILD_DIR-build"
- qmake -qt=qt5 -v
- qmake -qt=qt5 -Wall -Wlogic -Wparser CONFIG+=debug_and_release "$TRAVIS_BUILD_DIR"
- popd
script:
- cppcheck --error-exitcode=1 --quiet
--suppress=syntaxError:test/unit/src/core/testawsabstractresponse.cpp
.
- make -C "$TRAVIS_BUILD_DIR-build" -j2 all
- make -C "$TRAVIS_BUILD_DIR-build" -j2 check TESTARGS=-silent
after_success:
# Generate LCOV coverage reports
- make -C "$TRAVIS_BUILD_DIR-build/test/unit/all" -j2 coverage
- sed -i -e "s|^SF:/home/travis/build/libqtaws|SF:$TRAVIS_BUILD_DIR|"
"$TRAVIS_BUILD_DIR-build/release/unit-test-all-tmp/coverage.info"
# Report code coverage to coveralls.io
- lcoveralls --retry-count 5
"$TRAVIS_BUILD_DIR-build/release/unit-test-all-tmp/coverage.info"
# Report code coverage to codecov.io
- curl https://codecov.io/bash > /tmp/codecov.sh
- bash /tmp/codecov.sh -f "$TRAVIS_BUILD_DIR-build/release/unit-test-all-tmp/coverage.info"