<commit_before>
version: 2

jobs:
    build:
        docker:
            - image: rustlang/rust:nightly
              environment:
                  RUSTFLAGS: -C link-dead-code

        steps:
            - checkout
            - run:
                name: "Report versions"
                command: |
                    rustc -vV
                    cargo -vV
            - run:
                name: "Install rustfmt"
                command: |
                    rustup component add rustfmt-preview
            - run:
                name: "Cargo test"
                command: |
                    export RUST_BACKTRACE=1
                    cargo test --all-features
            - run:
                name: "C++ test"
                command: |
                    gcc --version
                    g++ --version
                    apt-get update
                    apt-get install cmake -y
                    cmake --version
                    mkdir build
                    cd build
                    cmake ..
                    make
                    cd ../bin/x86_64
                    ./cpp-raw
            - run:
                name: "Build kcov"
                command: |
                    apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake binutils-dev libiberty-dev -y
                    wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
                    tar xzf master.tar.gz
                    cd kcov-master
                    mkdir build
                    cd build
                    cmake ..
                    make
                    make install DESTDIR=../../kcov-build
                    cd ../..
                    rm -rf kcov-master
            - run:
                name: "Run kcov"
                command: |
                    # Set up the environment. We need LD_LIBRARY_PATH to include rust libs for
                    # the rust tests to execute without cargo.
                    export LD_LIBRARY_PATH=/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:${PWD}/bin/AMD64/lib

                    export KCOV=${PWD}/kcov-build/usr/local/bin/kcov
                    export KCOV_OUT=${PWD}/target/cov
                    export KCOV_INCLUDE=${PWD}
                    export KCOV_EXCLUDE=${PWD}/test
                    export KCOV_FLAGS=--verify
                    export RUN_KCOV="$KCOV --include-pattern=$KCOV_INCLUDE --exclude-pattern=$KCOV_EXCLUDE $KCOV_FLAGS $KCOV_OUT"
                    mkdir -p $KCOV_OUT

                    # Rust tests
                    for file in target/debug/*-[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f];
                    do
                        ${RUN_KCOV} "$file"
                    done

                    for file in intercom-attributes/tests/data/*.source.rs;
                    do
                        CARGO_PKG_NAME="source" ${RUN_KCOV} rustc --crate-name source --crate-type lib "$file" --out-dir target/test_out -L dependency=target/debug/deps --extern intercom=target/debug/libintercom.rlib --pretty=expanded -Z unstable-options > /dev/null;
                    done

                    # C++ tests
                    ( cd bin/x86_64 && ${RUN_KCOV} cpp-raw )

                    bash <( curl -s https://codecov.io/bash )
<commit_msg>Disable kcov<commit_after>
version: 2

jobs:
    build:
        docker:
            - image: rustlang/rust:nightly
              environment:
                  RUSTFLAGS: -C link-dead-code

        steps:
            - checkout
            - run:
                name: "Report versions"
                command: |
                    rustc -vV
                    cargo -vV
            - run:
                name: "Install rustfmt"
                command: |
                    rustup component add rustfmt-preview
            - run:
                name: "Cargo test"
                command: |
                    export RUST_BACKTRACE=1
                    cargo test --all-features
            - run:
                name: "C++ test"
                command: |
                    gcc --version
                    g++ --version
                    apt-get update
                    apt-get install cmake -y
                    cmake --version
                    mkdir build
                    cd build
                    cmake ..
                    make
                    cd ../bin/x86_64
                    ./cpp-raw
{'fraction_non_alphanumeric': 0.09131107671899182, 'fraction_numerical': 0.012160070749502542, 'mean_word_length': 0.8709677419354839, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '3538889', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1147, 'n_words': 260}