#!/bin/sh -e

# Script to parse the output generated by make checkr.,
# Exits with non-zero return code if any tests failed.
# This can be used inside of a CI environment.

for numerr in `grep RESULT check.out | grep Failed: | cut -d " " -f 4`
  do 
  if [ "$numerr" -ne "0" ]
    then 
    echo "At least one test failed. Examine check.out for details"
    exit 1
  fi
done
