packages feed

Hoed-0.3.1: test.Stk

#!/bin/bash

TESTS=`ls dist/build | grep hoed-tests-Stk`
FAIL=0

echo "Testing Hoed-stk"
echo

# Ensure there is a directory to execute in.
if [ ! -d tests/exe ]; then
        mkdir tests/exe
fi

rm -f tests/exe/*
cd tests/exe
for t in $TESTS; do
  eval ../../dist/build/$t/$t &> $t.out
  diff $t.graph ../ref/$t.graph &> $t.diff
  if [ $? -eq 0 ]; then
    echo "[OK] $t"
  else
    FAIL=1
    echo -n "["
    echo -en '\E[37;31m'"\033[1m!!\033[0m" # red "!!" on white background
    tput sgr0                              # reset colour
    echo "] $t"
    diff -y $t.graph ../ref/$t.graph       # a side-by-side comparison
  fi
done

exit $FAIL