#! /bin/bash

NUMRUNS=1000
ITRCOUNT=0
#TESTJDK=/JDKs/jdk1.8.0b115/
#TESTJDK=/JDKs/jdk1.8.0b129/
#TESTJDK=/JDKs/jdk1.7.0_45/
TESTJDK=/JDKs/jdk1.7.0_60b07/
#TESTJDK=/JDKs/jdk1.9.0b02/
#TESTJDK=/JDKs/jdk1.6.0_03/
TESTPATH=/home/bchristi/WORK/6835233/instrument/ParallelTransformerLoader.sh

while [ $ITRCOUNT -lt $NUMRUNS ]; do
    echo "Test iter $ITRCOUNT"
    ITRDIR="itr${ITRCOUNT}"
    mkdir $ITRDIR
    cd $ITRDIR
    jtreg -jdk:$TESTJDK $TESTPATH

    RESULT=$?
    cd ..
    if [ $RESULT -ne 0 ]; then 
        echo "Iteration $ITRCOUNT returned non-zero"
        exit
    fi
    let ITRCOUNT=ITRCOUNT+1
done
echo "All iterations completed successfully"

