travis: check format in clang build

I created a dedicated target (before script). Might not be the best idea
This commit is contained in:
Gregory Hainaut 2016-08-26 19:00:12 +02:00
parent 411a25b610
commit c6d42c09d8
2 changed files with 14 additions and 2 deletions

View File

@ -26,6 +26,9 @@ matrix:
before_install: before_install:
- ./travis.sh before_install - ./travis.sh before_install
before_script:
- ./travis.sh before_script
script: script:
- ./travis.sh script - ./travis.sh script

View File

@ -2,6 +2,12 @@
set -ex set -ex
clang_syntax_check() {
if [ "${CXX}" = "clang++" ]; then
./linux_various/check_format.sh
fi
}
linux_32_before_install() { linux_32_before_install() {
# Build worker is 64-bit only by default it seems. # Build worker is 64-bit only by default it seems.
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
@ -15,7 +21,7 @@ linux_32_before_install() {
# g++-4.9-multilib is necessary for compiler dependencies. 4.8 currently # g++-4.9-multilib is necessary for compiler dependencies. 4.8 currently
# has dependency issues, but 4.9 from the toolchain repo seems to work # has dependency issues, but 4.9 from the toolchain repo seems to work
# fine, so let's just use that. # fine, so let's just use that.
COMPILER_PACKAGE="clang-${VERSION} g++-4.9-multilib" COMPILER_PACKAGE="clang-${VERSION} g++-4.9-multilib clang-format-${VERSION}"
fi fi
if [ "${CXX}" = "g++" ]; then if [ "${CXX}" = "g++" ]; then
COMPILER_PACKAGE="g++-${VERSION}-multilib" COMPILER_PACKAGE="g++-${VERSION}-multilib"
@ -85,7 +91,7 @@ linux_64_before_install() {
if [ "${CXX}" = "clang++" ]; then if [ "${CXX}" = "clang++" ]; then
sudo apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key sudo apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
sudo add-apt-repository -y "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-${VERSION} main" sudo add-apt-repository -y "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-${VERSION} main"
COMPILER_PACKAGE="clang-${VERSION}" COMPILER_PACKAGE="clang-${VERSION} clang-format-${VERSION}"
fi fi
if [ "${CXX}" = "g++" ]; then if [ "${CXX}" = "g++" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
@ -143,6 +149,9 @@ case "${1}" in
before_install|script) before_install|script)
${TRAVIS_OS_NAME}_${BITS}_${1} ${TRAVIS_OS_NAME}_${BITS}_${1}
;; ;;
before_script)
clang_syntax_check
;;
after_success) after_success)
${TRAVIS_OS_NAME}_${1} ${TRAVIS_OS_NAME}_${1}
;; ;;