From 1697a615a10cc984de34a0b8ad145a948628c754 Mon Sep 17 00:00:00 2001 From: MichaelPena7 <122485247+MichaelPena7@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:44:20 -0800 Subject: [PATCH 1/2] Update grade.sh --- grade.sh | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/grade.sh b/grade.sh index a5abf25..b2c3645 100644 --- a/grade.sh +++ b/grade.sh @@ -1,5 +1,40 @@ CPATH='.:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar' +CHECKEDFILE='ListExamples.java' rm -rf student-submission git clone $1 student-submission -echo 'Finished cloning' \ No newline at end of file + +echo 'Finished cloning...' + +cd student-submission + +if [[ -f $CHECKEDFILE ]] +then + echo $CHECKEDFILE 'found!' +else + echo 'error:' $CHECKEDFILE 'not found.' +exit +fi + +echo '/////' + +javac $CHECKEDFILE + +if [[ $? -ne 0 ]] +then + echo 'error:' $CHECKEDFILE 'did not compile' + exit + +else + echo $CHECKEDFILE 'compiles!' +fi + +cd .. + +javac -cp ".;lib/hamcrest-core-1.3.jar;lib/junit-4.13.2.jar" *.java +echo 'compiling JUnit...' +java -cp ".;lib/junit-4.13.2.jar;lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore TestListExamples.java + +count=$(java -cp . ListExamples) + +echo $? 'out of' $count 'tests passed' From 9935879489fae24c09e162d83855cac4ee81e76f Mon Sep 17 00:00:00 2001 From: MichaelPena7 <122485247+MichaelPena7@users.noreply.github.com> Date: Wed, 1 Mar 2023 12:15:20 -0800 Subject: [PATCH 2/2] Update grade.sh --- grade.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grade.sh b/grade.sh index b2c3645..cf83a3b 100644 --- a/grade.sh +++ b/grade.sh @@ -31,6 +31,8 @@ fi cd .. +cp student-submission/ListExamples.java ./ + javac -cp ".;lib/hamcrest-core-1.3.jar;lib/junit-4.13.2.jar" *.java echo 'compiling JUnit...' java -cp ".;lib/junit-4.13.2.jar;lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore TestListExamples.java