<commit_before>language: c

dist: xenial

# container-based builds
sudo: false

git:
  depth: 1

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - BUILD=autotools

matrix:
  include:
    - compiler: gcc
      env: BUILD=cmake
    - compiler: clang
      # LSan does not work in containers https://github.com/travis-ci/travis-ci/issues/9033
      sudo: true
      env: BUILD=cmake CMAKE_OPTION="-DUSE_VALGRIND=no -DNO_UNDEFINED=no" CFLAGS="-fsanitize=address -fsanitize=undefined"
    - compiler: gcc
      env: BUILD=cmake CMAKE_OPTION="-DENABLE_GCOV=yes -DUSE_VALGRIND=no" COVERALLS=yes
    - compiler: clang
      env: BUILD=cmake CMAKE_OPTION="-DWITH_INTERNAL_SQLITE3=yes"
    - compiler: gcc
      env: BUILD=autotools CONFIGURE_OPTION="--with-internal-sqlite3=yes"
    - compiler: gcc
      env: BUILD=cmake CMAKE_OPTION="-DWITH_SQLITE3=no"
    - compiler: clang
      env: BUILD=autotools CONFIGURE_OPTION="--with-sqlite3=no"


before_install:
  - pip install --user cpp-coveralls
  - P_JOBS="-j$(getconf _NPROCESSORS_ONLN)"

script:
  - if [ x$BUILD == xautotools ]; then ./autogen.sh && ./configure $CONFIGURE_OPTION && make $P_JOBS V=1 CFLAGS="$CFLAGS -Wall -Werror -Wno-unused-const-variable" && make $P_JOBS check && make $P_JOBS release && LC_ALL=c sort data/tsi.src > data/tsi.src.sort && diff data/tsi.src data/tsi.src.sort; fi
  - if [ x$BUILD == xcmake ]; then CFLAGS="$CFLAGS -Wall -Werror -Wno-unused-const-variable" cmake . $CMAKE_OPTION && make $P_JOBS && make $P_JOBS check && LC_ALL=C sort data/tsi.src > data/tsi.src.sort && diff data/tsi.src data/tsi.src.sort; fi

after_success:
  - if [ x$COVERALLS == xyes ]; then coveralls --exclude src/tools --exclude contrib --exclude test --exclude thirdparty --exclude-pattern '.*CMake[^/]+\.c(?:pp)?' --exclude-pattern '.*/[_A-Z0-9]+\.c(?:pp)?' --exclude-pattern '[^\.]*\.h'; fi


addons:
  coverity_scan:
    project:
      name: "chewing/libchewing"
      description: "Build submitted via Travis CI"
    notification_email: <EMAIL>
    build_command_prepend: "./autogen.sh && ./configure && make clean"
    build_command: "make $P_JOBS"
    branch_pattern: coverity_scan
  apt:
    packages:
    # packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
    - cmake
    - cmake-data
    - texinfo<commit_msg>Don't run tests in parallel<commit_after>language: c

dist: xenial

# container-based builds
sudo: false

git:
  depth: 1

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    - secure: "<KEY>
    - BUILD=autotools

matrix:
  include:
    - compiler: gcc
      env: BUILD=cmake
    - compiler: clang
      # LSan does not work in containers https://github.com/travis-ci/travis-ci/issues/9033
      sudo: true
      env: BUILD=cmake CMAKE_OPTION="-DUSE_VALGRIND=no -DNO_UNDEFINED=no" CFLAGS="-fsanitize=address -fsanitize=undefined"
    - compiler: gcc
      env: BUILD=cmake CMAKE_OPTION="-DENABLE_GCOV=yes -DUSE_VALGRIND=no" COVERALLS=yes
    - compiler: clang
      env: BUILD=cmake CMAKE_OPTION="-DWITH_INTERNAL_SQLITE3=yes"
    - compiler: gcc
      env: BUILD=autotools CONFIGURE_OPTION="--with-internal-sqlite3=yes"
    - compiler: gcc
      env: BUILD=cmake CMAKE_OPTION="-DWITH_SQLITE3=no"
    - compiler: clang
      env: BUILD=autotools CONFIGURE_OPTION="--with-sqlite3=no"


before_install:
  - pip install --user cpp-coveralls
  - P_JOBS="-j$(getconf _NPROCESSORS_ONLN)"

script:
  - if [ x$BUILD == xautotools ]; then ./autogen.sh && ./configure $CONFIGURE_OPTION && make $P_JOBS V=1 CFLAGS="$CFLAGS -Wall -Werror -Wno-unused-const-variable" && make -j1 check && make $P_JOBS release && LC_ALL=c sort data/tsi.src > data/tsi.src.sort && diff data/tsi.src data/tsi.src.sort; fi
  - if [ x$BUILD == xcmake ]; then CFLAGS="$CFLAGS -Wall -Werror -Wno-unused-const-variable" cmake . $CMAKE_OPTION && make $P_JOBS && make $P_JOBS check && LC_ALL=C sort data/tsi.src > data/tsi.src.sort && diff data/tsi.src data/tsi.src.sort; fi

after_success:
  - if [ x$COVERALLS == xyes ]; then coveralls --exclude src/tools --exclude contrib --exclude test --exclude thirdparty --exclude-pattern '.*CMake[^/]+\.c(?:pp)?' --exclude-pattern '.*/[_A-Z0-9]+\.c(?:pp)?' --exclude-pattern '[^\.]*\.h'; fi


addons:
  coverity_scan:
    project:
      name: "chewing/libchewing"
      description: "Build submitted via Travis CI"
    notification_email: <EMAIL>
    build_command_prepend: "./autogen.sh && ./configure && make clean"
    build_command: "make $P_JOBS"
    branch_pattern: coverity_scan
  apt:
    packages:
    # packages list: https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise
    - cmake
    - cmake-data
    - texinfo
{'fraction_non_alphanumeric': 0.13952071486596263, 'fraction_numerical': 0.005077173030056864, 'mean_word_length': 3.381672597864769, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '2696612', 'n_tokens_mistral': 1846, 'n_tokens_neox': 1793, 'n_words': 395}