# Create your grading script here
# set -e
rm -rf student-submission
git clone $1 student-submission
cd student-submission
if [[ ! -f ListExamples.java ]]
then
echo "File does not exist"
exit N
fi
if [[ -e ListExamples.java ]]
then
echo "File does not exist"
exit N
fi
javac -cp ".;../lib/hamcrest-core-1.3.jar;../lib/junit-4.13.2.jar" *.java
java -cp ".;../lib/junit-4.13.2.jar;../lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore ListExamples
rm -rf student-submission
:
git clone $1 student-submission
:
>out.txt
to see the standard output, there was none, so this line does not contain any standart output.cd student-submission
:
[[ ! -f ListExamples.java ]]
as a condition:
[[ ! -e ListExamples.java ]]
as a condition:
javac -cp ".;../lib/hamcrest-core-1.3.jar;../lib/junit-4.13.2.jar" *.java
:
java -cp ".;../lib/junit-4.13.2.jar;../lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore ListExamples
:
ListExamples.java:15: error: ';' expected
result.add(0, s)
^
1 error
This is the case since the student forgot to add a semicolon, ending the command short to give a standard syntax error
-f
and one with -e
. Both of these if statments are return false, since there will always be a file after the clone. echo "File does not exist"
exit N