mirror of https://github.com/01-edu/public.git
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.
35 lines
664 B
35 lines
664 B
5 years ago
|
#!/bin/sh
|
||
|
|
||
5 years ago
|
set -o errexit
|
||
|
set -o pipefail
|
||
5 years ago
|
IFS='
|
||
|
'
|
||
|
|
||
|
cp -rT /app /jail
|
||
|
|
||
5 years ago
|
if test "$EXPECTED_FILES"; then
|
||
|
echo -n 'Formatting (with `goimports -d .`) ... '
|
||
5 years ago
|
cd /jail/student
|
||
5 years ago
|
s=$(goimports -d .)
|
||
5 years ago
|
if test "$s"; then
|
||
|
echo
|
||
|
echo "$s"
|
||
|
exit 1
|
||
|
fi
|
||
|
echo OK
|
||
5 years ago
|
if test "$ALLOWED_FUNCTIONS"; then
|
||
5 years ago
|
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
|
||
5 years ago
|
go test -failfast '-run=(?i)'test${EXERCISE}
|