summaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: f8c4f66cbbdab9185cbd155a3ed77b1b5d783039 (plain) (blame)
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

language: cpp

addons:
  apt:
    sources:
     - ubuntu-toolchain-r-test
     - llvm-toolchain-trusty
    packages:
     - ninja-build
     - llvm-dev
     - libclang-dev
     - clang

before_install:
 # Install a supported cmake version (>= 3.4.3)
 - wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-rc1-Linux-x86_64.sh 
 - sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local

 # Extract the version number from the most-recently installed LLVM
 - VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'`

 # Absolute paths to LLVM's root and bin directory
 - ROOT_PATH=`llvm-config-$VERSION --prefix`
 - BIN_PATH=`llvm-config-$VERSION --bindir`

script:
# Build IWYU
 - mkdir build
 - cd build
 - cmake -GNinja -DIWYU_LLVM_ROOT_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$BIN_PATH/clang -DCMAKE_CXX_COMPILER=$BIN_PATH/clang++ -DCMAKE_INSTALL_PREFIX=./ ../
 - ninja install

# Test IWYU
 - cd ..
 - python run_iwyu_tests.py -- build/bin/include-what-you-use
 - python fix_includes_test.py