Skip to content
Snippets Groups Projects
Commit 8383eb7e authored by Dragoș-Iulian ARGINT (94922)'s avatar Dragoș-Iulian ARGINT (94922)
Browse files

Resize Total computation in checker.sh and add vm-checker-next tags


Signed-off-by: default avatarDragos Iulian ARGINT <dragos.argint@stud.acs.upb.ro>
parent d0fb8a5e
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,31 @@ usage() ...@@ -17,10 +17,31 @@ usage()
timeout_exceeded() timeout_exceeded()
{ {
echo TIMEOUT EXCEEDED !!! killing the process echo TIMEOUT EXCEEDED !!! killing the process
echo "<VMCK_NEXT_END>"
pkill -SIGKILL qemu pkill -SIGKILL qemu
exit 1 exit 1
} }
compute_total()
{
local output=$1
points=$(cat $output | egrep "Total:" | egrep "\ *([0-9]+)" -o | head -n 1)
points_total=$(cat $output | egrep "Total:" | egrep "\ *([0-9]+)" -o | tail -n 1)
if [[ $points != "" ]] && [[ $points_total != "" ]]; then
python3 -c "print('Total: ' + str(int ($points * 100 / $points_total)) + '/' + '100')"
echo "<VMCK_NEXT_END>"
fi
}
dump_output()
{
local output=$1
echo "<VMCK_NEXT_BEGIN>"
cat $output
}
run_checker() run_checker()
{ {
local assignment_mod=$1 local assignment_mod=$1
...@@ -71,7 +92,8 @@ run_checker() ...@@ -71,7 +92,8 @@ run_checker()
if ((timeout >= TIMEOUT)); then if ((timeout >= TIMEOUT)); then
if [ -f $output ]; then if [ -f $output ]; then
echo "" echo ""
cat $output dump_output $output
compute_total $output
fi fi
timeout_exceeded timeout_exceeded
fi fi
...@@ -80,7 +102,8 @@ run_checker() ...@@ -80,7 +102,8 @@ run_checker()
echo -n . echo -n .
done done
echo "" echo ""
cat $output dump_output $output
compute_total $output
popd &> /dev/null popd &> /dev/null
} }
......
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