#!/bin/bash

SCRIPTFLAGS=
while [ $# -gt 0 ]; do
case $1 in
"-coverage") SCRIPTFLAGS+=" -coverage"; shift 1 ;;
"-rt2") SCRIPTFLAGS=" -rt2"; shift 1 ;;
*) echo "Usage: $0 [-rt2] [-coverage]"; exit 1 ;;
esac
done

echo "Batch execution of Runtime tests: creating 1 report for each script file"
echo "You must have a symlink in this directory named perl and pointing to perl 5.6.0 or higher"

echo "./perl ../Tools/SAtester.pl $SCRIPTFLAGS -log runtime1.report runtime1.script"
./perl ../Tools/SAtester.pl $SCRIPTFLAGS -log runtime1.report runtime1.script

echo "./perl ../Tools/SAtester.pl $SCRIPTFLAGS -legacy -log runtime_legacy.report runtime_legacy.script"
./perl ../Tools/SAtester.pl $SCRIPTFLAGS -legacy -log runtime_legacy.report runtime_legacy.script

echo "Finished. Reports are generated with .report extension."

