<commit_before>#!/bin/bash

BASEDIR=`dirname "$0"`
DIFF=`which diff`

cd "$BASEDIR"

if [ ! -x "$DIFF" ]
then
    echo "Cannot find the diff command. Exiting."
    exit 1
fi

if [ -x "$BASEDIR/../andromeda" ]
then
  ANDROMEDA="$BASEDIR/../andromeda"
elif [ -x "$BASEDIR/../andromeda.native" ]
then
  ANDROMEDA="$BASEDIR/../andromeda.byte"
elif [ -x "$BASEDIR/../andromeda.byte" ]
then
  ANDROMEDA="$BASEDIR/../andromeda.byte"
else
  echo "Cannot find the Andromeda executable. Compile Andromeda first."
  exit 1
fi

VALIDATE=0
if [ "$1" = "-v" ]
then
    VALIDATE=1
fi

for FILE in $BASEDIR/*.m31
  do
  "$ANDROMEDA" "$FILE" >"$FILE.out" 2>&1
  if [ -f $FILE.ref ]
      then
      RESULT=`"$DIFF" "$FILE.out" "$FILE.ref"`
      if [ "$?" = "0" ]
      then
      echo "Passed:  $FILE"
      rm "$FILE.out"
      else
      echo "FAILED:  $FILE"
      if [ $VALIDATE = "1" ]
          then
          "$DIFF" "$FILE.out" "$FILE.ref"
          read -p "Validate $FILE.out as new $FILE.ref? (y/n) [n] " ans
          if [ "$ans" = "y" -o "$ans" = "Y" ]
          then
          mv "$FILE.out" "$FILE.ref"
          echo "Validated: $FILE"
          fi
      fi
      fi

  else
      mv "$FILE.out" "$FILE.ref"
      echo "Created: $FILE.ref"
  fi
done<commit_msg>Do not report successful tests.<commit_after>#!/bin/bash

BASEDIR=`dirname "$0"`
DIFF=`which diff`
PRINTF=`which printf`

cd "$BASEDIR"

if [ ! -x "$DIFF" ]
then
    echo "Cannot find the diff command. Exiting."
    exit 1
fi

if [ ! -x "$PRINTF" ]
then
  echo "Cuould not find the printf command. Falling back on echo -- expect ugly output."
  PRINTF="echo"
fi

if [ -x "$BASEDIR/../andromeda" ]
then
  ANDROMEDA="$BASEDIR/../andromeda"
elif [ -x "$BASEDIR/../andromeda.native" ]
then
  ANDROMEDA="$BASEDIR/../andromeda.byte"
elif [ -x "$BASEDIR/../andromeda.byte" ]
then
  ANDROMEDA="$BASEDIR/../andromeda.byte"
else
  echo "Cannot find the Andromeda executable. Compile Andromeda first."
  exit 1
fi

VALIDATE=0
if [ "$1" = "-v" ]
then
    VALIDATE=1
fi
for FILE in $BASEDIR/*.m31
  do
  "$ANDROMEDA" "$FILE" >"$FILE.out" 2>&1
  if [ -f $FILE.ref ]
      then
      RESULT=`"$DIFF" "$FILE.out" "$FILE.ref"`
      if [ "$?" = "0" ]
      then
      $PRINTF "Test: $FILE                        \r"
      rm "$FILE.out"
      else
      echo "FAILED:  $FILE"
      if [ $VALIDATE = "1" ]
          then
          "$DIFF" "$FILE.out" "$FILE.ref"
          read -p "Validate $FILE.out as new $FILE.ref? (y/n) [n] " ans
          if [ "$ans" = "y" -o "$ans" = "Y" ]
          then
          mv "$FILE.out" "$FILE.ref"
          echo "Validated: $FILE"
          fi
      fi
      fi

  else
      mv "$FILE.out" "$FILE.ref"
      echo "Created: $FILE.ref                        "
  fi
done
echo "Done.                                       "
{'fraction_non_alphanumeric': 0.17327617006073598, 'fraction_numerical': 0.00857449088960343, 'mean_word_length': 1.9504741833508956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1248013', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1081, 'n_words': 284}