<commit_before>#!/bin/bash
set -e

build_configuration() {
    echo "Building configuration $1"
    mkdir -p build
    cd build
    cmake $1 ..
    make
    make test
    mkdir -p root
    make DESTDIR=root install
    cd ..
}

cleanup() {
    cd build
    make DESTDIR=root uninstall
    make clean
    rm sampleclient
    rm sampleserver
    cd ..
#    rm -rf build
}

build_configuration "-DCMAKE_BUILD_TYPE=Debug -DSOCKET_SERVER=YES -DSOCKET_CLIENT=YES -DHTTP_SERVER=YES -DHTTP_CLIENT=YES -DCOMPILE_STUBGEN=YES"

echo "Compiling examples"
cd build
g++ ../src/examples/simpleclient.cpp -Iroot/usr/local/include -Lroot/usr/local/lib -ljsonrpccpp-client -ljsoncpp -ljsonrpccpp-common -lcurl -o sampleclient 
g++ ../src/examples/simpleserver.cpp -Iroot/usr/local/include -Lroot/usr/local/lib -ljsonrpccpp-server -ljsoncpp -ljsonrpccpp-common -lmicrohttpd -o sampleserver
test -f sampleclient
test -f sampleserver

mkdir -p reports

echo "Generating valgrind report"
valgrind --leak-check=full --xml=yes --xml-file=reports/valgrind.xml ./bin/unit_testsuite --log_format=XML --log_sink=reports/tests.xml --log_level=all --report_level=no 


echo "Generating coverage report"
gcovr -x -r .. > reports/coverage.xml
gcovr -r .. --html --html-details -o reports/coverage.html

echo "Generating cppcheck report"
cppcheck --enable=all --xml ../src 2> reports/cppcheck.xml

cd ..
echo "Cleanup that mess"
cleanup

echo "Integration successful"
<commit_msg>fixing dev/ci.sh<commit_after>#!/bin/bash
set -e

build_configuration() {
    echo "Building configuration $1"
    mkdir -p build
    cd build
    cmake $1 ..
    make
    make test
    mkdir -p root
    make DESTDIR=root install
    cd ..
}

cleanup() {
    cd build
    make DESTDIR=root uninstall
    make clean
    rm sampleclient
    rm sampleserver
    cd ..
#    rm -rf build
}

build_configuration "-DCMAKE_BUILD_TYPE=Debug -DHTTP_SERVER=YES -DHTTP_CLIENT=YES -DCOMPILE_STUBGEN=YES -DCOMPILE_EXAMPLES=YES -DCOMPILE_TESTS=YES"

echo "Compiling examples"
cd build
g++ ../src/examples/simpleclient.cpp -Iroot/usr/local/include -Lroot/usr/local/lib -ljsonrpccpp-client -ljsoncpp -ljsonrpccpp-common -lcurl -o sampleclient 
g++ ../src/examples/simpleserver.cpp -Iroot/usr/local/include -Lroot/usr/local/lib -ljsonrpccpp-server -ljsoncpp -ljsonrpccpp-common -lmicrohttpd -o sampleserver
test -f sampleclient
test -f sampleserver

mkdir -p reports

echo "Generating valgrind report"
valgrind --leak-check=full --xml=yes --xml-file=reports/valgrind.xml ./bin/unit_testsuite --log_format=XML --log_sink=reports/tests.xml --log_level=all --report_level=no 


echo "Generating coverage report"
gcovr -x -r .. > reports/coverage.xml
gcovr -r .. --html --html-details -o reports/coverage.html

echo "Generating cppcheck report"
cppcheck --enable=all --xml ../src 2> reports/cppcheck.xml

cd ..
echo "Cleanup that mess"
cleanup

echo "Integration successful"

{'fraction_non_alphanumeric': 0.11655172413793104, 'fraction_numerical': 0.0020689655172413794, 'mean_word_length': 3.3689759036144578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '2668637', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1015, 'n_words': 257}