test: Add gofmt to test

This commit is contained in:
Alex Crawford 2014-08-25 12:36:04 -07:00
parent fb0187b197
commit e90fe3eba8

8
test
View File

@ -26,9 +26,9 @@ declare -a TESTPKGS=(initialize
network)
if [ -z "$PKG" ]; then
GOFMTPATH="$TESTPKGS coreos-cloudinit.go"
GOFMTPATH="${TESTPKGS[*]} coreos-cloudinit.go"
# prepend repo path to each package
TESTPKGS="${TESTPKGS[@]/#/${REPO_PATH}/} ./"
TESTPKGS="${TESTPKGS[*]/#/${REPO_PATH}/} ./"
else
GOFMTPATH="$TESTPKGS"
# strip out slashes and dots from PKG=./foo/
@ -43,5 +43,9 @@ go test ${COVER} $@ ${TESTPKGS}
echo "Checking gofmt..."
fmtRes=$(gofmt -l $GOFMTPATH)
if [ -n "$fmtRes" ]; then
echo "$fmtRes"
exit 1
fi
echo "Success"