<commit_before>#! /bin/bash

GHC=../../../../../../../compiler/stage2/ghc-inplace
OPTS="-package ndp\
      -fglasgow-exts -O2 -funbox-strict-fields\
      -fliberate-case-threshold100 -fno-method-sharing"

if [ "x$@" = "x" ]
then
  tests=`ls *.hs`
else
  tests=$@
fi

for file in $tests
do
  rules=`sed -n 's/-- >[[:space:]]*\([0-9]\+\)[[:space:]]\+\([^[:space:]]\+\)/\1 \2/p' $file`
  log=`echo $file | sed 's/\.hs$/.log/'`
  echo "$GHC $OPTS -c $file -ddump-simpl-stats" > $log
  if $GHC $OPTS -c $file -ddump-simpl-stats >> $log
  then
    oldIFS=$IFS
    IFS='
'
    for rule in `sed -n 's/-- >[[:space:]]*\([0-9]\+\)[[:space:]]\+\([^[:space:]]\+\)/\1 \2/p' $file`
    do
      if ! grep "$rule" $log > /dev/null 2>&1
      then
        echo "FAIL: $file ($rule)"
        break
      fi
    done
    IFS=$oldIFS
  else
    echo FAIL: $file - compiler error
  fi
done
rm -f *.hi *.o

<commit_msg>test/fusion/runtst.sh now accepts --verbose (doesn't do much)<commit_after>#! /bin/bash

GHC=../../../../../../../compiler/stage2/ghc-inplace
OPTS="-package ndp\
      -fglasgow-exts -O2 -funbox-strict-fields\
      -fliberate-case-threshold100 -fno-method-sharing"

verbose=no
tests=

exec 6> /dev/null

for arg
do
  case $arg in
    --verbose|-v) exec 6>&1
                  ;;
    *)            tests="$tests $arg"
                  ;;
  esac
done

tests=${tests:=`ls *.hs`}

for file in $tests
do
  echo Testing $file >&6
  rules=`sed -n 's/-- >[[:space:]]*\([0-9]\+\)[[:space:]]\+\([^[:space:]]\+\)/\1 \2/p' $file`
  log=`echo $file | sed 's/\.hs$/.log/'`
  echo "$GHC $OPTS -c $file -ddump-simpl-stats" >&6
  if $GHC $OPTS -c $file -ddump-simpl-stats > $log
  then
    oldIFS=$IFS
    IFS='
'
    for rule in `sed -n 's/-- >[[:space:]]*\([0-9]\+\)[[:space:]]\+\([^[:space:]]\+\)/\1 \2/p' $file`
    do
      if ! grep "$rule" $log > /dev/null 2>&1
      then
        echo "FAIL: $file ($rule)"
        break
      fi
    done
    IFS=$oldIFS
  else
    echo FAIL: $file - compiler error
  fi
done
rm -f *.hi *.o


{'fraction_non_alphanumeric': 0.24913323427439327, 'fraction_numerical': 0.01733531451213472, 'mean_word_length': 2.028485757121439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '6189272', 'n_tokens_mistral': 886, 'n_tokens_neox': 837, 'n_words': 197}