forked from include-what-you-use/include-what-you-use
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
41 lines (34 loc) · 1.26 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
language: cpp
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty
packages:
- ninja-build
# TODO: These should really be the snapshots packages, but they are currently
# broken. Remove the '-9' once they get fixed (see issue #642 for more info)
- llvm-9-dev
- llvm-9-tools
- libclang-9-dev
- clang-9
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 -DCMAKE_PREFIX_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
- python iwyu_tool_test.py