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

Feedback #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
35 changes: 34 additions & 1 deletion grade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,37 @@ 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'
echo 'Finished cloning'

cd student-submission

if [[ -f ListExamples.java ]]
then
echo 'ListExamples.java exists'
else
echo 'ListExamples.java does not exist'
exit
fi

cp ../TestListExamples.java .
cp -r ../lib .

javac -cp $CPATH *.java
echo 'Finished compiling'

java -cp $CPATH org.junit.runner.JUnitCore TestListExamples > ../output.txt
echo 'Finished running tests'

if [[ `grep -h "OK" ../output.txt` != "" ]]
then
echo 'All tests passed'
else
TESTS=`grep -h "Tests run" ../output.txt`
echo $TESTS
fi



# rm -rf student-submission
# echo 'Finished cleaning up'

18 changes: 18 additions & 0 deletions output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
JUnit version 4.13.2
.E
Time: 0.686
There was 1 failure:
1) testMergeRightEnd(TestListExamples)
org.junit.runners.model.TestTimedOutException: test timed out after 500 milliseconds
at [email protected]/java.util.Arrays.copyOf(Arrays.java:3512)
at [email protected]/java.util.Arrays.copyOf(Arrays.java:3481)
at [email protected]/java.util.ArrayList.grow(ArrayList.java:237)
at [email protected]/java.util.ArrayList.grow(ArrayList.java:244)
at [email protected]/java.util.ArrayList.add(ArrayList.java:454)
at [email protected]/java.util.ArrayList.add(ArrayList.java:467)
at app//ListExamples.merge(ListExamples.java:42)
at app//TestListExamples.testMergeRightEnd(TestListExamples.java:17)

FAILURES!!!
Tests run: 1, Failures: 1