<commit_before>language: cpp

dist: trusty
sudo: required

branches:
  only:
    - master

matrix:
  include:
  # Linux clang builds
  - os: linux
    compiler: clang
    env: COMPILER=clang++-4.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
        packages: [
          'cmake',
          'clang-4.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  - os: linux
    compiler: clang
    env: COMPILER=clang++-5.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
        packages: [
          'cmake',
          'clang-5.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  - os: linux
    compiler: clang
    env: COMPILER=clang++-6.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
        packages: [
          'cmake',
          'clang-6.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  # Linux GCC builds
  - os: linux
    compiler: gcc
    env: COMPILER=g++-4.9
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-4.9', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

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

  - os: linux
    compiler: gcc
    env: COMPILER=g++-6
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-6', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

  - os: linux
    compiler: gcc
    env: COMPILER=g++-7
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-7', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

  - os: linux
    compiler: gcc
    env: COMPILER=g++-8
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-8', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

install:
  - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
  - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}

before_script:
  - export CXX=${COMPILER}
  - cd ${TRAVIS_BUILD_DIR}

  # Debug build
  - cmake -H. -BBuild-Debug
    -DCMAKE_BUILD_TYPE=Debug
    -DPISTACHE_BUILD_EXAMPLES=true
    -DPISTACHE_BUILD_TESTS=true
    -DPISTACHE_SSL=true

  # Enable core dumps
  - ulimit -c unlimited -S

  # Release build
  - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -DPISTACHE_SSL=true

script:
  - # Debug build
  - cd Build-Debug
  - make -j 2 all test ARGS="-V"

  - # Release build
  - cd ../Build-Release
  - make -j 2

after_failure:
  - COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) # find core file
  - if [[ -f "$COREFILE" ]]; then gdb -c "$COREFILE" example -ex "thread apply all bt" -ex "set pagination 0" -batch; fi<commit_msg>travis - print few core dump related system information<commit_after>language: cpp

dist: trusty
sudo: true

branches:
  only:
    - master

matrix:
  include:
  # Linux clang builds
  - os: linux
    compiler: clang
    env: COMPILER=clang++-4.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
        packages: [
          'cmake',
          'clang-4.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  - os: linux
    compiler: clang
    env: COMPILER=clang++-5.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
        packages: [
          'cmake',
          'clang-5.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  - os: linux
    compiler: clang
    env: COMPILER=clang++-6.0
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
        packages: [
          'cmake',
          'clang-6.0',
          'libstdc++-6-dev',
          'libssl-dev',
          'libcurl4-openssl-dev',
          'gdb'
        ]

  # Linux GCC builds
  - os: linux
    compiler: gcc
    env: COMPILER=g++-4.9
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-4.9', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

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

  - os: linux
    compiler: gcc
    env: COMPILER=g++-6
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-6', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

  - os: linux
    compiler: gcc
    env: COMPILER=g++-7
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-7', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

  - os: linux
    compiler: gcc
    env: COMPILER=g++-8
    addons:
      apt:
        sources: ['ubuntu-toolchain-r-test']
        packages: ['g++-8', 'libssl-dev', 'libcurl4-openssl-dev', 'gdb']

install:
  - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
  - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}

before_script:
  - export CXX=${COMPILER}
  - cd ${TRAVIS_BUILD_DIR}

  # Enable core dumps
  - ulimit -c
  - ulimit -a -S
  - ulimit -a -H

  # Print debug system information
  - cat /proc/sys/kernel/core_pattern
  - cat /etc/default/apport
  - service --status-all || true
  - initctl list || true

  # Debug build
  - cmake -H. -BBuild-Debug
    -DCMAKE_BUILD_TYPE=Debug
    -DPISTACHE_BUILD_EXAMPLES=true
    -DPISTACHE_BUILD_TESTS=true
    -DPISTACHE_SSL=true

  # Release build
  - cmake -H. -BBuild-Release -DCMAKE_BUILD_TYPE=Release -DPISTACHE_SSL=true

script:
  - # Debug build
  - cd Build-Debug
  - make -j 2 all test ARGS="-V"

  - # Release build
  - cd ../Build-Release
  - make -j 2

after_failure:
  # find and print core file
  - COREFILE=$(find ./ -maxdepth 1 -name "core*" -print | head -n 1) 
  - if [[ -f "$COREFILE" ]]; then
    gdb -c "$COREFILE" -ex "thread apply all bt" -ex "set pagination 0" -batch;
    fi
{'fraction_non_alphanumeric': 0.15965982028241335, 'fraction_numerical': 0.014762516046213094, 'mean_word_length': 2.0024084778420037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2163280', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2350, 'n_words': 486}