Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Update grade.sh #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion grade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,24 @@ CPATH='.:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar'

rm -rf student-submission
git clone $1 student-submission
echo 'Finished cloning'
cd student-submission
echo 'Finished cloning'
if [[ -f ListExamples.java ]]
then
echo "ListExamples found"
else
echo "need file ListExamples.java"
exit 1
fi
cp ./ListExamples.java ../

javac -cp ".;lib/hamcrest-core-1.3.jar;lib/junit-4.13.2.jar" *.java
if [[ $? -ne 0 ]]
then
echo "Compilation fails"
exit 1
else
echo "Compile success"
fi

java -cp ".;lib/junit-4.13.2.jar;lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore TestListExamples