# Test configuration for Travis CI. See <https://travis-ci.org/>.
language: cpp

compiler:
  - gcc
  - clang

env:
  global:
    - CXXFLAGS="-O2 -pedantic -Wall -Wextra -Werror -Wno-missing-braces -Wno-long-long -Wno-unused-parameter -Wno-strict-aliasing -Wno-unknown-pragmas"
    - OMP_NUM_THREADS=4

before_install:
  - sudo apt-get update -qq

# Install cmake cppcheck
install:
  - sudo apt-get install -y cmake cppcheck valgrind

# Test build.sh script
before_script:
  - if [ "$CXX" = "g++" ]; then cmake .; fi
  - if [ "$CXX" = "clang++" ]; then cmake . -DWITH_OPENMP=OFF; fi
  - make -j4
  - ldd primesum
  - cppcheck src include --error-exitcode=1 -ilib

# Run primecount tests
script:
  - ./primesum --test
  - valgrind --error-exitcode=1 ./primesum 1e14

# Test configuration for Travis CI. See <https://travis-ci.org/>.
language: cpp

compiler:
  - gcc
  - clang

env:
  global:
    - CXXFLAGS="-O2 -pedantic -Wall -Wextra -Werror -Wno-missing-braces -Wno-long-long -Wno-unused-parameter -Wno-strict-aliasing -Wno-unknown-pragmas"
    - OMP_NUM_THREADS=4

before_install:
  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  - sudo apt-get update -qq

# Install cmake cppcheck
install:
  - sudo apt-get install -y gcc-5 g++-5 make cmake cppcheck valgrind
  - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

# Test build.sh script
before_script:
  - if [ "$CXX" = "g++" ]; then cmake .; fi
  - if [ "$CXX" = "clang++" ]; then cmake . -DWITH_OPENMP=OFF; fi
  - make -j4
  - ldd primesum
  - cppcheck src include --error-exitcode=1 -ilib

# Run primecount tests
script:
  - ./primesum --test
  - valgrind --error-exitcode=1 ./primesum 1e14

Use GCC 5 instead of GCC 4.x
Use GCC 5 instead of GCC 4.x