aboutsummaryrefslogblamecommitdiff
path: root/examples/sml/run.sh
blob: fcaea5d9af3929daa6b4bb043146e5f2e542d45a (plain) (tree)






















                                                                                 
#!/bin/sh

abort () {
    if [ "x$1" != "x" ]; then
	echo "$1"
    fi
    printf "\n\n{\"scores\": {}}"
    exit 0
}

[ -d handin ] || mkdir handin

[ -f handin.tar ] || \
    abort "Submission is expected to be at handin.tar. This file does not exist!"

tar -xf handin.tar -C handin || \
    abort "Failed to extract submission."

ml-build sources.cm Main.main grader || \
    abort "Failed to compile autograder. Please contact course staff."

sml @SMLload grader.* || \
    abort "SML autograder exited with error. Please contact course staff."