<commit_before>#!/bin/sh

ARGD=""
ARGE=""
if [ x"$1" = x"-v" -o x"$1" = x"-V" ]; then
    ARGD="-l debug"
    ARGE="-V"
fi

echo "Starting test ..."

timeout 5s ./examples/ex1 $ARGE
if [ $? -eq 0 ]; then
    echo "Test FAIL! (1)"
    exit 1
fi
sleep 1

echo "Starting watchdogd ..."
./watchdogd $ARGD -n -p --test-mode &
WDOG=$!
sleep 5

# This test should take ~40 seconds to run
echo "Starting API test ..."
timeout 45s ./examples/ex1 $ARGE
result=$?

# Stop watchdogd
kill $WDOG

if [ $result -ne 0 ]; then
    echo "Test FAIL! (2)"
    exit 1
fi

echo "Test OK!"
exit 0
<commit_msg>Fix search path to watchdogd in test script<commit_after>#!/bin/sh

ARGD=""
ARGE=""
if [ x"$1" = x"-v" -o x"$1" = x"-V" ]; then
    ARGD="-l debug"
    ARGE="-V"
fi

echo "Starting test ..."

timeout 5s ./examples/ex1 $ARGE
if [ $? -eq 0 ]; then
    echo "Test FAIL! (1)"
    exit 1
fi
sleep 1

echo "Starting watchdogd ..."
./src/watchdogd $ARGD -n -p --test-mode &
WDOG=$!
sleep 5

# This test should take ~40 seconds to run
echo "Starting API test ..."
timeout 45s ./examples/ex1 $ARGE
result=$?

# Stop watchdogd
kill $WDOG

if [ $result -ne 0 ]; then
    echo "Test FAIL! (2)"
    exit 1
fi

echo "Test OK!"
exit 0

{'fraction_non_alphanumeric': 0.17495854063018243, 'fraction_numerical': 0.029850746268656716, 'mean_word_length': 2.6465256797583083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2785365', 'n_tokens_mistral': 532, 'n_tokens_neox': 479, 'n_words': 173}