-
Notifications
You must be signed in to change notification settings - Fork 0
/
checktypes.sh
45 lines (39 loc) · 1.32 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
42
43
44
#!/bin/bash
# DO NOT EDIT THIS FILE
TARGETS="dictionary.cmo dictionarySet.cmo listDictionary.cmo \
authors.cmo test.cmo"
OCAMLBUILD="ocamlbuild -use-ocamlfind -plugin-tag package(bisect_ppx-ocamlbuild)"
$OCAMLBUILD $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 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