summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 00963844048a9fd838d7c3e27071563db82a9738 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright (C) 2018 Sebastian Pipping <sebastian@pipping.org>
# Licensed under the MIT license

language: cpp
dist: xenial

addons:
  apt:
    sources:
    # Clang 8:
      - llvm-toolchain-xenial-8
      - ubuntu-toolchain-r-test
    packages:
      - clang-8
      - cmake
      - lzip
    # Documentation:
      - doxygen
      - graphviz
      - qt4-dev-tools
      - qtchooser

script:
  - set -e
  - GTEST_VERSION=1.8.1
    ; GTEST_PREFIX=~/.local/
    ; wget https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz
    && tar xf release-${GTEST_VERSION}.tar.gz
    && ( cd googletest-release-${GTEST_VERSION}/
      && cmake
          -DBUILD_SHARED_LIBS=ON
          -DCVF_VERSION=${GTEST_VERSION}
          -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX}
          .
      && make
      && make install )
  - mkdir build
  - pushd build
  - compile_flags=(
        -pipe

        -O1
        -g
        -fsanitize=address
        -fno-omit-frame-pointer

        -Wall
        -Wextra
        -pedantic
    )
    && CFLAGS="${compile_flags[*]} -std=c89"
    && CXXFLAGS="${compile_flags[*]} -std=c++98"
    && LDFLAGS='-g -fsanitize=address'
    && cmake_args=(
        -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX}

        -Wdev
        -Werror=dev
        -Wdeprecated
        -Werror=deprecated

        -DCMAKE_C_COMPILER=clang-8
        -DCMAKE_CXX_COMPILER=clang++-8
        -DCMAKE_C_FLAGS="${CFLAGS}"
        -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
        -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
        -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}"
        -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}"
    )
    && cmake "${cmake_args[@]}" -DCMAKE_INSTALL_INCLUDEDIR=include123 ..  # -Werror would fail checks!
  - make VERBOSE=1 C_FLAGS="${CFLAGS} -fPIC -Werror" CXX_FLAGS="${CXXFLAGS} -Werror" all
  - make VERBOSE=1 C_FLAGS="${CFLAGS} -fPIC -Werror" CXX_FLAGS="${CXXFLAGS} -Werror" test ARGS=--verbose
  - cat Testing/Temporary/LastTest.log
  - make install
  - ./doc/release.sh
  - make DESTDIR="${PWD}"/ROOT/ install
  - find ROOT | sort
  - popd
  - pushd cmake/test_find_package
  - cmake "${cmake_args[@]}" .
  - make VERBOSE=1
  - ./hello
  - popd
  - git fetch --tags --unshallow origin  # for "git describe" in make-distcheck.sh
  - ./make-distcheck.sh -DCMAKE_INSTALL_PREFIX:PATH=${GTEST_PREFIX}  # without AddressSanitizer
  - "! git status | fgrep -A100 'Untracked files:'  # works best at the very end"