#!/bin/sh

# Run the test suites
echo "----------------------------------------------------------------------"
echo "Executing the test suites"
echo "It is not unusual for these test suites to take several hours to run."
echo 
echo

unset LC_ALL
tcc -p -e -s $HOME/scen.exec test_sets

if [ $? -ne 0 ]; then
  echo "Failed to execute the test suites correctly."
  echo "Either they are not installed properly or you may"
  echo "be missing the lsb linker $LDSO on your system."
  echo 
  exit 1
fi

echo ""

# Produce a report of the results
REPORT_NAME=report.`date  +"%Y%m%d%H%m"`
(cd results; awk -f `which vres` `ls -d 0* | tail -n 1`/journal)
echo
echo "Producing formal report ($HOME/results/$REPORT_NAME)"
(cd results; vrpt `ls -d 0* | tail -n 1`/journal >$HOME/results/$REPORT_NAME)

# Gather some machine info for reference
echo
echo "Gathering machine/package info"
$HOME/scripts/common/machine_info

echo

echo "Finished."

