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

make checker.sh output the running time


Signed-off-by: default avatarDragoș-Iulian ARGINT <dragos.argint@stud.acs.upb.ro>
parent 07763ecb
No related branches found
No related tags found
No related merge requests found
Pipeline #20142 passed
#!/bin/bash
TIMEOUT=300 # 5 min
SO2_WORKSPACE=/linux/tools/labs
ASSIGNMENT0_TIMEOUT=300 # 5 min
ASSIGNMENT0_MOD=list.ko
ASSIGNMENT0_DIR=${SO2_WORKSPACE}/skels/assignments/0-list
ASSIGNMENT0_CHECKER_LOCAL_DIR=checker/0-list-checker
......@@ -10,6 +11,7 @@ ASSIGNMENT0_CHECKER_DIR=${SO2_WORKSPACE}/skels/assignments/0-list-checker
ASSIGNMENT0_OUTPUT=${SO2_WORKSPACE}/skels/0-list-output
ASSIGNMENT0_FINISHED=${SO2_WORKSPACE}/skels/0-list-finished
ASSIGNMENT1_TIMEOUT=300 # 5 min
ASSIGNMENT1_MOD=tracer.ko
ASSIGNMENT1_DIR=${SO2_WORKSPACE}/skels/assignments/1-tracer
ASSIGNMENT1_CHECKER_LOCAL_DIR=checker/1-tracer-checker
......@@ -19,6 +21,7 @@ ASSIGNMENT1_FINISHED=${SO2_WORKSPACE}/skels/1-tracer-finished
ASSIGNMENT1_HEADER_OVERWRITE=${SO2_WORKSPACE}/templates/assignments/1-tracer/tracer.h
ASSIGNMENT1_CHECKER_AUX_LIST="${ASSIGNMENT1_CHECKER_DIR}/_helper/tracer_helper.ko"
ASSIGNMENT2_TIMEOUT=300 # 5 min
ASSIGNMENT2_MOD=uart16550.ko
ASSIGNMENT2_DIR=${SO2_WORKSPACE}/skels/assignments/2-uart
ASSIGNMENT2_CHECKER_LOCAL_DIR=checker/2-uart-checker
......@@ -28,6 +31,7 @@ ASSIGNMENT2_FINISHED=${SO2_WORKSPACE}/skels/2-uart-finished
ASSIGNMENT2_HEADER_OVERWRITE=${SO2_WORKSPACE}/templates/assignments/2-uart/uart16550.h
ASSIGNMENT2_CHECKER_AUX_LIST="${ASSIGNMENT2_CHECKER_DIR}/_test/solution.ko"
ASSIGNMENT3_TIMEOUT=300 # 5 min
ASSIGNMENT3_MOD=ssr.ko
ASSIGNMENT3_DIR=${SO2_WORKSPACE}/skels/assignments/3-raid
ASSIGNMENT3_CHECKER_LOCAL_DIR=checker/3-raid-checker
......@@ -98,8 +102,10 @@ compute_total()
dump_output()
{
local output=$1
local timeout=$2
echo "<VMCK_NEXT_BEGIN>"
cat $output
echo "Running time $timeout/$TIMEOUT"
}
......@@ -190,7 +196,8 @@ run_checker()
fi
LINUX_ADD_CMDLINE="so2=$assignment" make checker &> /dev/null &
timeout=0
echo -n "CHECKER IS RUNNING"
while [ ! -f $finished ]
do
......@@ -207,25 +214,29 @@ run_checker()
echo -n .
done
echo ""
dump_output $output
dump_output $output $timeout
compute_total $output
popd &> /dev/null
}
case $1 in
0-list)
TIMEOUT=$ASSIGNMENT0_TIMEOUT
RECOVER_GRADE_TIMEOUT=0 # If set to 1, in case of a timeout, will calculate the total grade based on the output directory
run_checker $ASSIGNMENT0_MOD $ASSIGNMENT0_DIR $ASSIGNMENT0_CHECKER_LOCAL_DIR $ASSIGNMENT0_CHECKER_DIR $ASSIGNMENT0_OUTPUT $ASSIGNMENT0_FINISHED $1
;;
1-tracer)
TIMEOUT=$ASSIGNMENT1_TIMEOUT
RECOVER_GRADE_TIMEOUT=0 # If set to 1, in case of a timeout, will calculate the total grade based on the output directory
run_checker $ASSIGNMENT1_MOD $ASSIGNMENT1_DIR $ASSIGNMENT1_CHECKER_LOCAL_DIR $ASSIGNMENT1_CHECKER_DIR $ASSIGNMENT1_OUTPUT $ASSIGNMENT1_FINISHED $1 $ASSIGNMENT1_HEADER_OVERWRITE $ASSIGNMENT1_CHECKER_AUX_LIST
;;
2-uart)
TIMEOUT=$ASSIGNMENT2_TIMEOUT
RECOVER_GRADE_TIMEOUT=1 # If set to 1, in case of a timeout, will calculate the total grade based on the output directory
run_checker $ASSIGNMENT2_MOD $ASSIGNMENT2_DIR $ASSIGNMENT2_CHECKER_LOCAL_DIR $ASSIGNMENT2_CHECKER_DIR $ASSIGNMENT2_OUTPUT $ASSIGNMENT2_FINISHED $1 $ASSIGNMENT2_HEADER_OVERWRITE $ASSIGNMENT2_CHECKER_AUX_LIST
;;
3-raid)
TIMEOUT=$ASSIGNMENT3_TIMEOUT
RECOVER_GRADE_TIMEOUT=0 # If set to 1, in case of a timeout, will calculate the total grade based on the output directory
run_checker $ASSIGNMENT3_MOD $ASSIGNMENT3_DIR $ASSIGNMENT3_CHECKER_LOCAL_DIR $ASSIGNMENT3_CHECKER_DIR $ASSIGNMENT3_OUTPUT $ASSIGNMENT3_FINISHED $1 $ASSIGNMENT3_HEADER_OVERWRITE $ASSIGNMENT3_CHECKER_AUX_LIST
;;
......
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