.travis.yml 2.4 KB
Newer Older
N
Niels 已提交
1 2
language: cpp

3 4
dist: trusty
sudo: required
N
Niels 已提交
5

N
Niels 已提交
6
# from http://stackoverflow.com/a/32127147/266378
N
Niels 已提交
7 8 9 10 11 12 13 14 15 16
matrix:
  include:
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test']
          packages: ['g++-4.9', 'valgrind', 'python-pip', 'python-yaml']
      before_script:
        - pip install --user git+git://github.com/eddyxu/cpp-coveralls.git
N
cleanup  
Niels 已提交
17 18 19 20 21 22
      after_success:
        - make clean
        - touch src/json.hpp
        - make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage -std=c++11 -lstdc++" CXX=$COMPILER
        - ./json_unit "*"
        - coveralls --exclude test/catch.hpp --exclude test/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9'
N
Niels 已提交
23 24 25 26 27 28 29 30 31 32
      env: COMPILER=g++-4.9

    - os: linux
      compiler: gcc
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test']
          packages: ['g++-5', 'valgrind']
      env: COMPILER=g++-5

N
Niels 已提交
33 34 35 36 37 38 39 40
#    - os: linux
#      compiler: gcc
#      addons:
#        apt:
#          sources: ['ubuntu-toolchain-r-test']
#          packages: ['g++-6', 'valgrind']
#      env: COMPILER=g++-6

N
Niels 已提交
41 42
    # Clang 3.5 is not able to compile the code,
    # see https://travis-ci.org/nlohmann/json/jobs/126720186
N
Niels 已提交
43

N
Niels 已提交
44 45 46 47
    - os: linux
      compiler: clang
      addons:
        apt:
48
          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
N
Niels 已提交
49 50
          packages: ['clang-3.6', 'valgrind']
      env: COMPILER=clang++-3.6
N
Niels 已提交
51

N
Niels 已提交
52 53 54 55
    - os: linux
      compiler: clang
      addons:
        apt:
56
          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
N
Niels 已提交
57 58
          packages: ['clang-3.7', 'valgrind']
      env: COMPILER=clang++-3.7
N
Niels 已提交
59 60 61 62 63 64 65 66

    - os: linux
      compiler: clang
      addons:
        apt:
          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
          packages: ['clang-3.8', 'valgrind']
      env: COMPILER=clang++-3.8
N
Niels 已提交
67 68 69 70 71

    - os: linux
      compiler: clang
      addons:
        apt:
N
Niels 已提交
72
          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise']
N
Niels 已提交
73 74
          packages: ['clang-3.9', 'valgrind']
      env: COMPILER=clang++-3.9
N
Niels 已提交
75
     
N
Niels 已提交
76 77 78 79 80 81 82
    - os: osx
      osx_image: xcode7.3
      compiler: clang
      env: COMPILER=clang
      before_install:
        - brew update
        - brew install valgrind
N
Niels 已提交
83

N
Niels 已提交
84
script:
N
try  
Niels 已提交
85
  - make CXX=$COMPILER CXXFLAGS="-lstdc++"
86
  - ./json_unit "*"
N
Niels 已提交
87
  - valgrind --error-exitcode=1 --leak-check=full ./json_unit