# Unable to run LeakSanitizer propertly without root
#   https://github.com/travis-ci/travis-ci/issues/9033
sudo: true

language: cpp

compiler:
  - gcc
  - clang

env:
  global:
    - LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
    - CXXFLAGS="-g"

before_install:
  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi

install:
  - |
    if [ "${CXX}" == "g++" ]; then
      BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
      TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
    fi

script:
  - cd ${TRAVIS_BUILD_DIR}
  - CXXFLAGS="${BUILD_CXXFLAGS}" make -j
  - cd parser_sandbox
  - CXXFLAGS="${BUILD_CXXFLAGS}" make -j
  - cd ..
  - CXXFLAGS="${TEST_CXXFLAGS}" make test
  - cd parser_sandbox
  - CXXFLAGS="${TEST_CXXFLAGS}" make test

after_success:
  - |
    if [ "${CXX}" != "clang++" ]; then
      cd ${TRAVIS_BUILD_DIR}
      bash <(curl -s https://codecov.io/bash)
    fi

notifications:
  email: false

# Unable to run LeakSanitizer propertly without root
#   https://github.com/travis-ci/travis-ci/issues/9033
sudo: true

language: cpp

compiler:
  - gcc
  - clang

env:
  global:
    - LD_LIBRARY_PATH="${TRAVIS_BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
    - CXXFLAGS="-g"

before_install:
  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; fi

install:
  - |
    if [ "${CXX}" == "g++" ]; then
      BUILD_CXXFLAGS="${CXXFLAGS} -fprofile-arcs -ftest-coverage"
      TEST_CXXFLAGS="${CXXFLAGS} -lgcov --coverage"
    fi

script:
  - cd ${TRAVIS_BUILD_DIR}
  - CXXFLAGS="${BUILD_CXXFLAGS}" make -j
  - cd parser_sandbox
  - CXXFLAGS="${BUILD_CXXFLAGS}" make -j
  - cd ..
  - CXXFLAGS="${TEST_CXXFLAGS}" make test
  - cd parser_sandbox
  - CXXFLAGS="${TEST_CXXFLAGS}" make -j tests
  - make test

after_success:
  - |
    if [ "${CXX}" != "clang++" ]; then
      cd ${TRAVIS_BUILD_DIR}
      bash <(curl -s https://codecov.io/bash)
    fi

notifications:
  email: false

Build tests in parallel, run them sequentially
[CI] Build tests in parallel, run them sequentially
