#!/bin/sh

echo "Test script for assignment 3 submission."
echo "Notify hayest@cs if this script does not work correctly."
echo "Still in testing; more functionality coming later."
echo
WHOIAM=`whoami`
echo 'You should have copied a file named '$WHOIAM'.tar into the handin directory.'
echo

echo 'Creating and moving to /tmp/'$WHOIAM'1234'
mkdir '/tmp/'$WHOIAM'1234'
cd '/tmp/'$WHOIAM'1234'
echo 'Making copy of your submission.'
cp '/stage/classes/current/cspp535/handin/'$WHOIAM'.tar' .
echo '$ tar -xvf '$WHOIAM'.tar'
tar -xvf $WHOIAM'.tar'
echo 'cd assign4'
cd assign4
echo 'rm -f *.class'
rm -f *.class
echo 'make all'
make all
if [ 1=0 ] 
    then
        echo 'java FrameEditorTester'
        echo 'Check to make sure your app works the way it should'
        java FrameEditorTester
    else
        echo 'Not prepared to test your submission yet.  Please try again soon'
	echo 'Meanwhile, here is the listing of the .class files you created.'
	ls -l *.class
fi

cd
echo 'Deleting temporary files.'
rm -rf '/tmp/'$WHOIAM'1234'

