forked from ameer2158/NoteBook_2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade
40 lines (31 loc) · 865 Bytes
/
grade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
source grade_utils
TIMEOUT=30
run_in_folder_if_exists "$1"
if [ -z "$DEBUG" ]; then
printf "\n\n### Cleaning old files (to prevent this, export DEBUG=1) ###\n"
make -f Makefile clean
fi
total=0
i=0
let "i=i+3"
printf "\n\n### Check $i: all tests should pass\n"
call make -f Makefile test
grade_command ./test
printf "### Score $i: $grade\n"
total=$((total + grade * 3))
let "i=i+1"
printf "\n\n### Check $i: clang-tidy should run without warnings in user code\n"
grade_command make -f Makefile tidy
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: valgrind should run without errors\n"
grade_command make -f Makefile valgrind
printf "### Score $i: $grade\n"
total=$((total + grade))
total=$((total / i))
printf "\n\nGrade: $total\n\n"
if [ -z "$DEBUG" ]; then
make -f Makefile --silent clean
fi