<commit_before># Prepare the files needed to compile and run the tests

TOOL_DIR="./src/Tools/runtests_shell"
OUTPUT_DIR="$TOOL_DIR/bin/Debug/netcoreapp1.0"

PHP_TMP_FILE=$OUTPUT_DIR/php.out
PEACH_TMP_FILE=$OUTPUT_DIR/peach.out

COLOR_YELLOW="\033[1;33m"
COLOR_GREEN="\033[1;32m"
COLOR_RED="\033[1;31m"
COLOR_RESET="\033[0m"
HR="----------------------------------------------------------------------------------------------------------------------------------------------------------------"

# Restore the testing project to gather all dependencies
dotnet restore $TOOL_DIR

# Compile and run every PHP file in ./tests and check the output against the one from the PHP interpreter
for PHP_FILE in $(find $PWD/tests -name *.php)
do
  echo -n "Testing $PHP_FILE..."
  echo "$PHP_FILE" | grep -Eq ".*skip(\\([^)/]*\\))?_[^/]*$"
  if [ $? -eq 0 ];then
    echo -e $COLOR_YELLOW"SKIPPED"$COLOR_RESET
    continue;
  fi
  COMPILE_OUTPUT="$(dotnet build $TOOL_DIR /p:TestFile=$PHP_FILE)"
  if [ $PIPESTATUS != 0 ] ; then
    echo -e $COLOR_RED"Compilation error"$COLOR_RESET
    echo "$COMPILE_OUTPUT"
    FAILURE="FAILURE"
  else
    PHP_OUTPUT="$(php $PHP_FILE)"
    PEACH_OUTPUT="$(dotnet $OUTPUT_DIR/Test.dll)"

    if [ "$PHP_OUTPUT" = "$PEACH_OUTPUT" ] ; then
      echo -e $COLOR_GREEN"OK"$COLOR_RESET
    else
      echo -e $COLOR_RED"FAIL"$COLOR_RESET<commit_msg>Hide interpreter's error messages in Travis tests<commit_after># Prepare the files needed to compile and run the tests

TOOL_DIR="./src/Tools/runtests_shell"
OUTPUT_DIR="$TOOL_DIR/bin/Debug/netcoreapp1.0"

PHP_TMP_FILE=$OUTPUT_DIR/php.out
PEACH_TMP_FILE=$OUTPUT_DIR/peach.out

COLOR_YELLOW="\033[1;33m"
COLOR_GREEN="\033[1;32m"
COLOR_RED="\033[1;31m"
COLOR_RESET="\033[0m"
HR="----------------------------------------------------------------------------------------------------------------------------------------------------------------"

# Restore the testing project to gather all dependencies
dotnet restore $TOOL_DIR

# Compile and run every PHP file in ./tests and check the output against the one from the PHP interpreter
for PHP_FILE in $(find $PWD/tests -name *.php)
do
  echo -n "Testing $PHP_FILE..."
  echo "$PHP_FILE" | grep -Eq ".*skip(\\([^)/]*\\))?_[^/]*$"
  if [ $? -eq 0 ];then
    echo -e $COLOR_YELLOW"SKIPPED"$COLOR_RESET
    continue;
  fi
  COMPILE_OUTPUT="$(dotnet build $TOOL_DIR /p:TestFile=$PHP_FILE)"
  if [ $PIPESTATUS != 0 ] ; then
    echo -e $COLOR_RED"Compilation error"$COLOR_RESET
    echo "$COMPILE_OUTPUT"
    FAILURE="FAILURE"
  else
    PHP_OUTPUT="$(php -d display_errors=0 $PHP_FILE)"
    PEACH_OUTPUT="$(dotnet $OUTPUT_DIR/Test.dll)"

    if [ "$PHP_OUTPUT" = "$PEACH_OUTPUT" ] ; then
      echo -e $COLOR_GREEN"OK"$COLOR_RESET
    else
      echo -e $COLOR_RED"FAIL"$COLOR_RESET
{'fraction_non_alphanumeric': 0.24443646805455851, 'fraction_numerical': 0.019023689877961235, 'mean_word_length': 2.545801526717557, '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': '3088121', 'n_tokens_mistral': 968, 'n_tokens_neox': 906, 'n_words': 221}