From 96ebfd37ea5428974869d58d11f013d3b957e57a Mon Sep 17 00:00:00 2001 From: joc044 <122795748+joc044@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:12:36 -0700 Subject: [PATCH] Update grade.sh --- grade.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/grade.sh b/grade.sh index a5abf25..fb75c7e 100644 --- a/grade.sh +++ b/grade.sh @@ -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' \ No newline at end of file +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