<commit_before>#!/bin/bash
# Script run in the travis CI
set -ex

if [ "x$CPPUTEST_HOME" = "x" ] ; then
  export CPPUTEST_HOME=$TRAVIS_BUILD_DIR
fi

#if [[ "$CXX" == clang* ]]; then
#    export CXXFLAGS="-stdlib=libc++"
#fi

if [ "x$BUILD" = "xautotools" ]; then
    autoreconf -i ..
    ../configure
    make tdd
fi

if [ "x$BUILD" = "xcmake" ]; then
    BUILD_ARGS=("-DWERROR=ON")

    if [ -n "$CPP_STD" ]; then
        BUILD_ARGS+=("-DCMAKE_CXX_STANDARD=$CPP_STD")
    fi

    cmake --version
    cmake "${BUILD_ARGS[@]}" ..
    make
    ctest -V
fi

if [ "x$BUILD" = "xautotools_gtest" ]; then
    autoreconf -i ..
    ../configure
    make check_gtest
fi

if [ "x$BUILD" = "xcmake_gtest" ]; then
    pwd
    wget https://github.com/google/googletest/archive/release-1.6.0.zip -O gtest-1.6.0.zip  && unzip gtest-1.6.0.zip;
    wget https://github.com/google/googlemock/archive/release-1.6.0.zip -O gmock-1.6.0.zip  && unzip gmock-1.6.0.zip;
    unzip gtest-1.6.0.zip -d $TRAVIS_BUILD_DIR
    unzip gmock-1.6.0.zip -d $TRAVIS_BUILD_DIR
    cd $TRAVIS_BUILD_DIR
    mv googletest-release-1.6.0 googlemock-release-1.6.0/gtest
    cd googlemock-release-1.6.0
    autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make
    cd -
    export GMOCK_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0
    export GTEST_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0/gtest
    cmake . -DGMOCK=ON
    make
    ctest -V
fi

if [ "x$BUILD" = "xtest_report" ]; then
    if [ "x$TRAVIS_OS_NAME" = "xosx" ]; then
        brew install ant
    fi
    autoreconf -i ..
    ../configure
    make check
    ./CppUTestTests -ojunit
    ./CppUTestExtTests -ojunit
    cp ../scripts/generate_junit_report_ant.xml .
    ant -f generate_junit_report_ant.xml
fi

if [ "x$BUILD" = "xcmake_coverage" ]; then
    pip install --user cpp-coveralls

    cmake .. -DCMAKE_BUILD_TYPE=Debug -DC++11=ON -DCOVERAGE=ON -DLONGLONG=ON
    make
    ctest

    coveralls -b . -r .. -i "src" -i "include" --gcov-options="-lbc" || true
fi

if [ "x$BUILD" = "xautotools_cmake_install_test" ]; then
    autoreconf -i ..
    ../configure
    rm -rf install_autotools
    mkdir -p install_autotools
    make DESTDIR=install_autotools install<commit_msg>Some cleanup in travis CI build<commit_after>#!/bin/bash
# Script run in the travis CI
set -ex

if [ "x$CPPUTEST_HOME" = "x" ] ; then
  export CPPUTEST_HOME=$TRAVIS_BUILD_DIR
fi

if [ "x$BUILD" = "xautotools" ]; then
    autoreconf -i ..
    ../configure
    make tdd
fi

if [ "x$BUILD" = "xcmake" ]; then
    BUILD_ARGS=("-DWERROR=ON")

    if [ -n "$CPP_STD" ]; then
        BUILD_ARGS+=("-DCMAKE_CXX_STANDARD=$CPP_STD")
    fi

    cmake --version
    cmake "${BUILD_ARGS[@]}" ..
    make
    ctest -V
fi

if [ "x$BUILD" = "xautotools_gtest" ]; then
    autoreconf -i ..
    ../configure
    make check_gtest
fi

if [ "x$BUILD" = "xcmake_gtest" ]; then
    pwd
    wget https://github.com/google/googletest/archive/release-1.6.0.zip -O gtest-1.6.0.zip  && unzip gtest-1.6.0.zip;
    wget https://github.com/google/googlemock/archive/release-1.6.0.zip -O gmock-1.6.0.zip  && unzip gmock-1.6.0.zip;
    unzip gtest-1.6.0.zip -d $TRAVIS_BUILD_DIR
    unzip gmock-1.6.0.zip -d $TRAVIS_BUILD_DIR
    cd $TRAVIS_BUILD_DIR
    mv googletest-release-1.6.0 googlemock-release-1.6.0/gtest
    cd googlemock-release-1.6.0
    autoreconf -i; ./configure CXXFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1 && make
    cd -
    export GMOCK_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0
    export GTEST_HOME=$TRAVIS_BUILD_DIR/googlemock-release-1.6.0/gtest
    cmake . -DGMOCK=ON
    make
    ctest -V
fi

if [ "x$BUILD" = "xtest_report" ]; then
    autoreconf -i ..
    ../configure
    make check
    ./CppUTestTests -ojunit
    ./CppUTestExtTests -ojunit
    cp ../scripts/generate_junit_report_ant.xml .
    ant -f generate_junit_report_ant.xml
fi

if [ "x$BUILD" = "xcmake_coverage" ]; then
    pip install --user cpp-coveralls

    cmake .. -DCMAKE_BUILD_TYPE=Debug -DC++11=ON -DCOVERAGE=ON -DLONGLONG=ON
    make
    ctest

    coveralls -b . -r .. -i "src" -i "include" --gcov-options="-lbc" || true
fi

if [ "x$BUILD" = "xautotools_cmake_install_test" ]; then
    autoreconf -i ..
    ../configure
    rm -rf install_autotools
    mkdir -p install_autotools
    make DESTDIR=install_autotools install
{'fraction_non_alphanumeric': 0.14527732652587608, 'fraction_numerical': 0.019958226966813646, 'mean_word_length': 2.6743393009377665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2820944', 'n_tokens_mistral': 1805, 'n_tokens_neox': 1756, 'n_words': 345}