-
Notifications
You must be signed in to change notification settings - Fork 0
/
checktypes.sh
41 lines (36 loc) · 1.19 KB
/
checktypes.sh
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
#!/bin/bash
TARGETS="authors.cmo test.cmo"
ocamlbuild -use-ocamlfind $TARGETS
if [[ $? -ne 0 ]]; then
cat <<EOF
===========================================================
WARNING
Your code currently does not compile. You will receive
little to no credit for submitting this code. Check the
error messages above carefully to determine what is wrong.
See a consultant for help if you cannot determine what is
wrong.
===========================================================
EOF
exit 1
fi
if ocamlbuild -use-ocamlfind checktypes.cmo ; then
cat <<EOF
===========================================================
Your function names and types look good to me.
Congratulations!
===========================================================
EOF
else
cat <<EOF
===========================================================
WARNING
Your function names and types look broken to me. The code
that you submit might not compile on the grader's machine,
leading to heavy penalties. Please fix your names and
types. Check the error messages above carefully to
determine what is wrong. See a consultant for help if you
cannot determine what is wrong.
===========================================================
EOF
fi