forked from uncrustify/uncrustify
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.travis.yml
137 lines (124 loc) · 4.23 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
language: cpp
sudo: false
matrix:
include:
- os: linux
dist: trusty
env: BADGE=linux BUILD_TYPE=debug
- os: linux
dist: trusty
env: BADGE=linux BUILD_TYPE=release
- os: linux
dist: trusty
env: BADGE=linux BUILD_TYPE=release NO_MACRO_VARARG=1
# GCC 6
- os: linux
dist: trusty
env: BADGE=linux C_COMPILER=gcc-6 CXX_COMPILER=g++-6
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
# Clang 3.8 address sanitizer
- os: linux
dist: trusty
env: BADGE=linux BUILD_TYPE=asan C_COMPILER=clang-3.8 CXX_COMPILER=clang++-3.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
# mingw-w64 Win64 cross-compile
- os: linux
dist: trusty
env: BADGE=linux BUILD_TYPE=cross C_COMPILER=x86_64-w64-mingw32-gcc CXX_COMPILER=x86_64-w64-mingw32-g++
addons:
apt:
packages:
- mingw-w64
- binutils-mingw-w64
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- gcc-mingw-w64
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- g++-mingw-w64
- g++-mingw-w64-i686
- g++-mingw-w64-x86-64
- os: linux
dist: trusty
compiler: gcc
# OSX
- os: osx
env: BADGE=osx BUILD_TYPE=debug
- os: osx
env: BADGE=osx BUILD_TYPE=release
branches:
only:
- master
before_install:
- |
if [ "x${BUILD_TYPE}" == "xcoverage" ]; then
sudo apt-get update
sudo apt-get install -qy python3-pip lcov
pip3 install --user PyYAML
pip3 install --user --upgrade cpp-coveralls
fi
- if [ -n "${C_COMPILER}" ]; then export CC="${C_COMPILER}"; fi
- if [ -n "${CXX_COMPILER}" ]; then export CXX="${CXX_COMPILER}"; fi
- ${CXX} --version
- cmake --version
- mkdir build
- cd build
before_script:
# to stop the script after an error/warning
- set -e
# workarounds for OSX traivs build failure issues:
# 1. rvm overrides cd with a function so that it can hook into it to run some scripts from the new
# working directory. The workaround is to revert it to the builtin shell one.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then unset -f cd; fi
# 2. Redefine shell_session_update as a dummy function to avoid travis error:
# /Users/travis/.rvm/scripts/functions/support: line 57: shell_session_update: command not found.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then shell_session_update() { :; }; fi
# prepare make files with cmake
- |-
case "${BUILD_TYPE}" in
"coverage")
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_CODECOVERAGE=ON ..
;;
"asan")
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZER=address ..
;;
"ubsan")
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZER=undefined ..
;;
"cross")
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake -DCMAKE_EXE_LINKER_FLAGS="-static -s" ..
;;
"release")
cmake -DCMAKE_BUILD_TYPE=Release ..
;;
*)
cmake ..
;;
esac
script:
# build
- make VERBOSE=1
- if [ "x${BUILD_TYPE}" != "xcross" ]; then ctest --output-on-failure -j 4; fi
- if [ "x${BUILD_TYPE}" == "xcoverage" ]; then make coverage; fi
# test if all the sources are conform to the forUncrustifySources.cfg config file
- if [ "x${BUILD_TYPE}" == "xrelease" ]; then cd ../ && ./scripts/Run_uncrustify_for_sources.sh; cd -; fi
# test if uncrustify runs for (some) command line options
- if [ "x${BUILD_TYPE}" == "xrelease" ]; then cd ../tests/cli && ./test_cli_options.py; cd -; fi
# DO NOT REMOVE (debugging purposes)
#- /home/travis/build/uncrustify/uncrustify/build/uncrustify -l cs -c /home/travis/build/uncrustify/uncrustify/tests/config/U10-Cpp.cfg -f /home/travis/build/uncrustify/uncrustify/tests/input/cs/newlines.mm -L A
after_success:
# publish coverage data to coveralls
- if [ "x${BUILD_TYPE}" == "xcoverage" ]; then cd ../ && coveralls -l build/cmake_coverage.output -t $COVERALLS_TOKEN; fi