source ./build.sh
-TESTABLE="libcni pkg/invoke pkg/skel pkg/types pkg/types/current pkg/types/020 pkg/version pkg/version/testhelpers plugins/test/noop"
+# test everything that's not in vendor
+pushd "$GOPATH/src/$REPO_PATH" >/dev/null
+ TESTABLE="$(go list ./... | grep -v vendor | xargs echo)"
+popd >/dev/null
+
FORMATTABLE="$TESTABLE"
# user has not provided PKG override
FMT="$TEST"
fi
-# split TEST into an array and prepend REPO_PATH to each local package
-split=(${TEST// / })
-TEST=${split[@]/#/${REPO_PATH}/}
-
echo -n "Running tests "
function testrun {
sudo -E bash -c "umask 0; PATH=$GOROOT/bin:$(pwd)/bin:$PATH go test -covermode set $@"
fi
echo "Checking gofmt..."
-fmtRes=$(gofmt -l $FMT)
+fmtRes=$(go fmt $FMT)
if [ -n "${fmtRes}" ]; then
- echo -e "gofmt checking failed:\n${fmtRes}"
+ echo -e "go fmt checking failed:\n${fmtRes}"
exit 255
fi
echo "Checking govet..."
vetRes=$(go vet $TEST)
if [ -n "${vetRes}" ]; then
- echo -e "govet checking failed:\n${vetRes}"
+ echo -e "go vet checking failed:\n${vetRes}"
exit 255
fi