blob: 02a449b475b18d777d13fe35eaa3308236b7a5cc [file] [log] [blame]
Bram Moolenaar0600f352015-09-15 19:18:18 +02001language: c
Bram Moolenaar02113ed2017-08-06 17:06:24 +02002dist: trusty
Bram Moolenaar0600f352015-09-15 19:18:18 +02003
Bram Moolenaarb20617b2016-07-30 17:41:49 +02004os:
5 - osx
6 - linux
7
Bram Moolenaar0600f352015-09-15 19:18:18 +02008compiler:
9 - clang
10 - gcc
11
12env:
Bram Moolenaaref23c522019-06-09 14:15:29 +020013 global:
14 # pretend to play sounds
15 AUDIODEV=null
Bram Moolenaar01a6c212019-02-03 13:13:18 +010016 - &tiny-nogui
17 BUILD=yes TEST=test COVERAGE=no FEATURES=tiny "CONFOPT='--disable-gui'" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
18 - &tiny
19 BUILD=yes TEST=test COVERAGE=no FEATURES=tiny CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
20 - &asan # ASAN build
21 BUILD=yes TEST=test SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
Bram Moolenaare67a7d62018-09-05 22:25:50 +020022 FEATURES=huge SRCDIR=./src CHECK_AUTOCONF=no ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
23 "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
Bram Moolenaar01a6c212019-02-03 13:13:18 +010024 - &linux-huge
25 BUILD=yes TEST="scripttests test_libvterm" COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
Bram Moolenaarade55782018-07-01 21:12:55 +020026 "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
Bram Moolenaar01a6c212019-02-03 13:13:18 +010027 - &unittests
28 BUILD=no TEST=unittests COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
29 - &normal
30 BUILD=yes TEST=test COVERAGE=no FEATURES=normal CONFOPT= SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow CHECK_AUTOCONF=no
31 - &small
32 BUILD=yes TEST=test COVERAGE=no FEATURES=small CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
33 - &osx-huge # Mac OSX build
34 BUILD=yes TEST=test COVERAGE=no FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
Bram Moolenaarade55782018-07-01 21:12:55 +020035 "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp'"
Bram Moolenaar0600f352015-09-15 19:18:18 +020036
37sudo: false
38
Bram Moolenaar01a6c212019-02-03 13:13:18 +010039# instead of a 2*2*8 matrix (2*os + 2*compiler + 8*env),
Bram Moolenaarb20617b2016-07-30 17:41:49 +020040# exclude some builds on mac os x and linux
Bram Moolenaarb2e54b02019-01-19 13:46:50 +010041# on mac os x "tiny" is always without GUI
Bram Moolenaarb20617b2016-07-30 17:41:49 +020042# linux: 2*compiler + 5*env + mac: 2*compiler + 2*env
43matrix:
44 exclude:
45 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010046 env: *tiny
Bram Moolenaarb2e54b02019-01-19 13:46:50 +010047 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010048 env: *normal
Bram Moolenaarb20617b2016-07-30 17:41:49 +020049 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010050 env: *unittests
Bram Moolenaarb20617b2016-07-30 17:41:49 +020051 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010052 env: *small
Bram Moolenaarb20617b2016-07-30 17:41:49 +020053 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010054 env: *linux-huge
Bram Moolenaar1e076332017-01-26 20:11:12 +010055 - os: osx
Bram Moolenaar01a6c212019-02-03 13:13:18 +010056 env: *asan
Bram Moolenaar1e076332017-01-26 20:11:12 +010057 - os: linux
Bram Moolenaar02113ed2017-08-06 17:06:24 +020058 compiler: clang
Bram Moolenaar01a6c212019-02-03 13:13:18 +010059 env: *asan
Bram Moolenaarb20617b2016-07-30 17:41:49 +020060 - os: linux
61 compiler: clang
Bram Moolenaar01a6c212019-02-03 13:13:18 +010062 env: *unittests
Bram Moolenaarb20617b2016-07-30 17:41:49 +020063 - os: linux
64 compiler: clang
Bram Moolenaar01a6c212019-02-03 13:13:18 +010065 env: *small
Bram Moolenaarb20617b2016-07-30 17:41:49 +020066 - os: linux
Bram Moolenaar01a6c212019-02-03 13:13:18 +010067 env: *osx-huge
Bram Moolenaarb20617b2016-07-30 17:41:49 +020068
Bram Moolenaarc1d20992015-09-25 20:30:58 +020069branches:
70 except:
71 - /^v[0-9]/
72
Bram Moolenaar0600f352015-09-15 19:18:18 +020073addons:
74 apt:
Bram Moolenaar496555f2019-04-11 20:14:56 +020075 sources:
76 # Need msgfmt 0.19.8 to be able to generate .desktop files
77 - sourceline: 'ppa:ricotz/toolchain'
Bram Moolenaar0600f352015-09-15 19:18:18 +020078 packages:
Bram Moolenaar7b5f0a12015-12-30 17:40:43 +010079 - autoconf
Bram Moolenaar9e272172017-11-17 21:25:08 +010080 - clang
Bram Moolenaar0600f352015-09-15 19:18:18 +020081 - lcov
Bram Moolenaar496555f2019-04-11 20:14:56 +020082 - gettext
Bram Moolenaar427f5b62019-06-09 13:43:51 +020083 - libcanberra-dev
Bram Moolenaar0600f352015-09-15 19:18:18 +020084 - libperl-dev
85 - python-dev
86 - python3-dev
Bram Moolenaarcb25d182017-07-27 21:29:31 +020087 - liblua5.2-dev
88 - lua5.2
Bram Moolenaar02113ed2017-08-06 17:06:24 +020089 - ruby-dev
Bram Moolenaarade55782018-07-01 21:12:55 +020090 - tcl-dev
Bram Moolenaar47247282016-08-02 22:36:02 +020091 - cscope
Bram Moolenaar02113ed2017-08-06 17:06:24 +020092 - libgtk2.0-dev
Bram Moolenaar8e228e22019-06-06 15:13:19 +020093 - desktop-file-utils
Bram Moolenaar2339fa32019-01-28 22:59:36 +010094 homebrew:
95 packages:
96 - lua
97 update: true
Bram Moolenaar0600f352015-09-15 19:18:18 +020098
99before_install:
Bram Moolenaar02113ed2017-08-06 17:06:24 +0200100 - rvm reset
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100101 # Remove /opt/python/3.x.x/bin from $PATH for using system python3.
102 # ("pyenv global system" doesn't seem to work.)
103 - |
104 if [[ "${TRAVIS_OS_NAME}" = "linux" ]] && [[ "$(which python3)" =~ ^/opt/python/ ]]; then
105 export PATH=$(py3=$(which python3); echo ${PATH//${py3%/python3}:/})
106 fi
107 - |
108 if [[ "${COVERAGE}" = "yes" ]]; then
109 pip install --user cpp-coveralls
110 fi
111 # needed for https support for coveralls
112 # building cffi only works with gcc, not with clang
113 - |
114 if [[ "${COVERAGE}" = "yes" ]]; then
115 CC=gcc pip install --user pyopenssl ndg-httpsclient pyasn1
116 fi
117 # Lua is not installed on Travis OSX
118 - |
119 if [[ "${TRAVIS_OS_NAME}" = "osx" ]]; then
120 export LUA_PREFIX=/usr/local
121 fi
122 # Use llvm-cov instead of gcov when compiler is clang.
123 - |
124 if [[ "${TRAVIS_OS_NAME}" = "linux" ]] && [[ "${CC}" = "clang" ]]; then
125 ln -sf "$(which llvm-cov)" /home/travis/bin/gcov
126 fi
Bram Moolenaaref23c522019-06-09 14:15:29 +0200127 # Should make sound work (might not all be needed)
128 - |
129 if [[ "${TRAVIS_OS_NAME}" = "linux" ]]; then
130 sudo apt-get update -qq
131 sudo usermod -a -G audio travis
132 sudo apt-get install -y portaudio19-dev
133 sudo apt-get install -y libasound2-dev alsa-utils alsa-oss
134 sudo bash test/prep-dummy-soundcard.sh
135 sudo apt-get install -y lame
136 fi
Bram Moolenaar0600f352015-09-15 19:18:18 +0200137
Bram Moolenaare3505df2016-11-11 21:57:45 +0100138before_script:
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100139 # Start virtual framebuffer to be able to test the GUI. Does not work on OS X.
140 - |
141 if [[ "${TRAVIS_OS_NAME}" = "linux" ]]; then
142 export DISPLAY=:99.0
143 sh -e /etc/init.d/xvfb start && sleep 3
144 fi
Bram Moolenaare3505df2016-11-11 21:57:45 +0100145
Bram Moolenaar0600f352015-09-15 19:18:18 +0200146script:
147 - NPROC=$(getconf _NPROCESSORS_ONLN)
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200148 - set -o errexit
149 - echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100150 - |
151 if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
152 make -C src autoconf
153 fi
154 - |
155 if [[ -n "${SHADOWOPT}" ]]; then
156 make -C src shadow
157 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200158 # "./configure" changes its working directory into "$SRCDIR".
159 - ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
160 - echo -en "travis_fold:end:configure\\r\\033[0K"
161 - echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100162 - |
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200163 if [[ "${BUILD}" = "yes" ]]; then
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100164 make ${SHADOWOPT} -j${NPROC}
165 fi
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200166 - echo -en "travis_fold:end:build\\r\\033[0K"
167 - set +o errexit
168 - echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100169 # Show Vim version and also if_xx versions.
170 - |
171 if [[ "${BUILD}" = "yes" ]]; then
172 "${SRCDIR}"/vim --version
173 "${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-1.vim -c quit > /dev/null
174 "${SRCDIR}"/vim --not-a-term -u NONE -S "${SRCDIR}"/testdir/if_ver-2.vim -c quit > /dev/null
175 cat if_ver.txt
176 fi
177 - make ${SHADOWOPT} ${TEST}
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200178 - echo -en "travis_fold:end:test\\r\\033[0K"
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100179 - |
180 if [[ -n "${ASAN_OPTIONS}" ]]; then
181 while read log; do
182 asan_symbolize < "${log}"
Bram Moolenaardc9f9e92019-05-11 14:34:13 +0200183 false # exit 1 if there are ASAN logs
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100184 done < <(find . -type f -name 'asan.*' -size +0)
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100185 fi
Bram Moolenaar0600f352015-09-15 19:18:18 +0200186
187after_success:
Bram Moolenaar01a6c212019-02-03 13:13:18 +0100188 - |
189 if [[ "${COVERAGE}" = "yes" ]]; then
190 ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8 latin-1 EUC-KR
191 fi
192 - |
193 if [[ "${COVERAGE}" = "yes" ]]; then
194 (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
195 fi
Bram Moolenaar0600f352015-09-15 19:18:18 +0200196
197# vim:set sts=2 sw=2 tw=0 et: