-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
59 lines (45 loc) · 2.42 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
language: cpp
compiler:
- gcc
- clang
before_install:
# g++4.8
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# clang 3.5
- echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise main" | sudo tee -a /etc/apt/sources.list
- echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main" | sudo tee -a /etc/apt/sources.list
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# Cmake
- sudo add-apt-repository -y ppa:kalakris/cmake
- sudo apt-get update -qq
install:
- export SRC_DIR=$PWD
# g++4.8
- if [ "$CXX" = "g++" ]; then sudo apt-get install --allow-unauthenticated -qq g++-4.8 gcc-4.8; fi
- if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.8; fi
# clang 3.5
- if [ "$CXX" == "clang++" ]; then sudo apt-get install -qq clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.5 35 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.5; fi
#- if [ "$CXX" == "clang++" ]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.4 34 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-3.4; fi
# This fails probably because the clang and clang++ executables already exists. Maybe I could
# rename the files and try again ...
- sudo pip install cpp-coveralls coveralls
# CMake newest version
- sudo apt-get install --allow-unauthenticated -qq cmake
# Install lcov
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz -O /tmp/lcov.tar.gz
- cd /tmp/ && tar xf lcov.tar.gz
- sudo make -C lcov-1.11/ install
# Install gtest
- wget https://googletest.googlecode.com/files/gtest-1.7.0.zip -O /tmp/gtest.zip
- cd /tmp/ && unzip gtest.zip && cd gtest-1.7.0
- mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=ON .. && make && sudo mv libg* /usr/local/lib
- cd .. && sudo cp include/gtest /usr/local/include -R && cd $SRC_DIR
before_script:
- export SRC_DIR=$PWD && mkdir build && export BIN_DIR=$PWD
- bash travis/cmake.sh
script:
- cd build
- make
- bin/test_all
- if [ "$CXX" = "g++" ]; then coveralls -E "/usr/.*" -E "build/*.h" -E ".*/CMakeFiles/.*" --root $SRC_DIR --build-root $BIN_DIR; fi