<commit_before>#!/bin/sh
set -xe
git clone --depth 1 --branch 0.8.6 https://github.com/edenhill/librdkafka.git
(
    cd librdkafka
    ./configure
    make
    sudo make install
)
sudo ldconfig
phpize
./configure
make
make test<commit_msg>Test under valgrind<commit_after>#!/bin/sh

set -xe

git clone --depth 1 --branch 0.8.6 https://github.com/edenhill/librdkafka.git
(
    cd librdkafka
    ./configure
    make
    sudo make install
)
sudo ldconfig

sudo apt-get update
sudo apt-get install -qq valgrind

echo "extension = $(pwd)/modules/rdkafka.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
phpenv config-rm xdebug.ini

phpize
./configure
make

PHP=$(which php)
REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE="$PHP" "$PHP" run-tests.php -q -m --show-diff
{'fraction_non_alphanumeric': 0.13151041666666666, 'fraction_numerical': 0.01171875, 'mean_word_length': 3.3446327683615817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '849438', 'n_tokens_mistral': 297, 'n_tokens_neox': 282, 'n_words': 72}