From 465fb70bdcb0acd7a13f8b06c821e9d7496e2603 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Thu, 13 Sep 2018 13:18:07 -0400 Subject: Imported tutch example --- examples/tutch/run.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 examples/tutch/run.sh (limited to 'examples/tutch/run.sh') diff --git a/examples/tutch/run.sh b/examples/tutch/run.sh new file mode 100755 index 0000000..ff313b2 --- /dev/null +++ b/examples/tutch/run.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +abort () { + if [ "x$1" != "x" ]; then + echo "$1" + fi + printf "\n\n{\"scores\": {}}" + exit 0 +} + +tar -mxf autograde.tar || \ + abort "Failed to extract autograder." + +[ -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." -- cgit v1.2.3