-
Notifications
You must be signed in to change notification settings - Fork 98
/
grade
40 lines (31 loc) · 906 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=20
run_in_folder_if_exists "$1"
printf "\n\n### Cleaning old files ###\n"
make -f Makefile clean
total=0
i=0
let "i=i+1"
printf "\n\n### Check $i: our demo program should compile with your class\n"
grade_command make -j8 -f Makefile demo
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: our demo program should run without errors\n"
grade_command ./demo
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: your test should compile \n"
grade_command make -j8 -f Makefile test
printf "### Score $i: $grade\n"
total=$((total + grade))
let "i=i+1"
printf "\n\n### Check $i: you should write some new tests\n"
grade_command ./test
printf "### Score $i: $grade\n"
total=$((total + grade))
total=$((total / i))
printf "\n\nGrade: $total\n\n"
make -f Makefile --silent clean