-
Notifications
You must be signed in to change notification settings - Fork 1
/
grade
54 lines (43 loc) · 1.18 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
source grade_utils
TIMEOUT=10
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+1"
printf "\n\n### Check $i: all tests should pass\n"
call make -f Makefile test1
grade_command ./test1
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: all tests should pass\n"
call make -f Makefile test2
grade_command ./test2
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: all tests should pass\n"
call make -f Makefile test3
grade_command ./test3
printf "### Score $i: $grade\n"
total=$((total + grade))
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