You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
664 B

#!/bin/sh
set -o errexit
set -o pipefail
IFS='
'
cp -rT /app /jail
if test "$EXPECTED_FILES"; then
echo -n 'Formatting (with `goimports -d .`) ... '
cd /jail/student
s=$(goimports -d .)
if test "$s"; then
echo
echo "$s"
exit 1
fi
echo OK
if test "$ALLOWED_FUNCTIONS"; then
rc "$EXPECTED_FILES" $ALLOWED_FUNCTIONS
fi
fi
cd /jail
if ! test -f ${EXERCISE}_test.go; then
echo No test file found for the exercise : "$EXERCISE"
exit 1
fi
# TODO: maybe change btree exercises so that they work without student code and then delete this line
find . -name '*_test.go' ! -name ${EXERCISE}_test.go -delete
go test -failfast '-run=(?i)'test${EXERCISE}