Skip to content
Snippets Groups Projects
Commit 547ea670 authored by Goik Martin's avatar Goik Martin
Browse files

Better automated evaluation

parent d753f0aa
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,30 @@
# TODO: devine marker string variable
# TODO: show non-compiling projects in logfile
#rm -rf Unpack
# The original examination project skeleton
PROJECTREF=~/workspace/GoikLectures/Klausuren/Sd1/2017Summer/Exam
# Representative of archive integrity
SRCREPRESENT=src/main/java/de/hdm_stuttgart/mi/sd1/aufgabe1/HandyAbrechnung.java
# The executable jar archive containing unit tests
TESTJAR=sd1_2017sommer_exam-0.9-fat-tests.jar
# Strings like e.g. "Aufgabe 2" referencing "Aufgabe 2: (30/50)"
declare -a MARKERS=("Aufgabe 1" "Aufgabe 2")
# No changes beyond this line
#--------------------------------------------------------------------------------------------
mkdir -p Unpack
rm -f ~/results.log
rm -rf ~/results.log /tmp/Reference
cp -r $PROJECTREF /tmp/Reference
pushd /tmp/Reference
mvn eclipse:clean clean;
rm -rf src/main/java
popd
for zip in $( ls *.zip); do
fbname=$(basename "$zip" .zip)
......@@ -18,21 +40,31 @@ for zip in $( ls *.zip); do
if [[ 1 = $nodeCount && 1 = $dirCount ]]; then
echo "Found exactly one directory component"
mv * project
if [ -f project/pom.xml ]; then
echo "found pom.xml"
tar zxf ~/goiksolution.tgz
mv project/src/main/java/de/hdm_stuttgart/sw1 GoikSolution/src/main/java/de/hdm_stuttgart
cd GoikSolution;
mvn compile
reachedPoints=`mvn exec:java -Dexec.mainClass="de.hdm_stuttgart.eval.ShowReachedPoints"|grep Test_Helper`
echo "$fbname $reachedPoints" >> ~/results.log
if [ -f project/$SRCREPRESENT ]; then
echo "found HandyAbrechnung.java"
cp -r /tmp/Reference .
mv project/src/main/java Reference/src/main
pushd Reference
mvn compile test-compile
if [ $? -eq 0 ] ; then
mvn -Dmaven.test.skip=true package
result=""
for mark in "${MARKERS[@]}"; do
result+=`java -jar target/$TESTJAR | grep "$mark"|sed 's/^[ ]*//'`
result+=" "
done
else
result="Project does not compile"
fi
popd
echo "$fbname $result" >> ~/results.log
else
echo "$fbname : No pom.xml found in project" >> ~/results.log
echo "$fbname : $SRCREPRESENT not found" >> ~/results.log
fi
else
echo "$fbname : Found more than one directory component" >> ~/results.log
fi
popd
popd # return from Unpack
rm -rf Unpack
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment