2014-03-05 04:50:54 +04:00
|
|
|
#!/bin/bash -e
|
2014-05-10 12:42:57 +04:00
|
|
|
|
|
|
|
source ./build
|
|
|
|
|
2015-08-12 20:53:32 +03:00
|
|
|
SRC="
|
2014-09-22 06:22:13 +04:00
|
|
|
config
|
2014-10-22 22:27:51 +04:00
|
|
|
config/validate
|
2014-09-22 06:22:13 +04:00
|
|
|
datasource
|
|
|
|
datasource/configdrive
|
|
|
|
datasource/file
|
|
|
|
datasource/metadata
|
|
|
|
datasource/metadata/cloudsigma
|
|
|
|
datasource/metadata/digitalocean
|
|
|
|
datasource/metadata/ec2
|
2015-03-26 10:23:27 +03:00
|
|
|
datasource/metadata/openstack
|
2014-09-22 06:22:13 +04:00
|
|
|
datasource/proc_cmdline
|
2015-02-14 08:01:44 +03:00
|
|
|
datasource/test
|
2014-09-22 06:22:13 +04:00
|
|
|
datasource/url
|
2015-05-19 07:10:34 +03:00
|
|
|
datasource/vmware
|
2014-10-10 22:27:27 +04:00
|
|
|
datasource/waagent
|
2014-09-22 06:22:13 +04:00
|
|
|
initialize
|
|
|
|
network
|
|
|
|
pkg
|
|
|
|
system
|
2015-11-10 19:26:27 +03:00
|
|
|
.
|
2015-08-12 20:53:32 +03:00
|
|
|
"
|
2014-03-05 04:50:54 +04:00
|
|
|
|
2015-08-12 20:53:32 +03:00
|
|
|
echo "Checking gofix..."
|
|
|
|
go tool fix -diff $SRC
|
2014-05-10 12:42:57 +04:00
|
|
|
|
|
|
|
echo "Checking gofmt..."
|
2015-08-12 20:53:32 +03:00
|
|
|
gofmt -d -e $SRC
|
|
|
|
|
|
|
|
# split SRC into an array and prepend REPO_PATH to each local package for go vet
|
|
|
|
split_vet=(${SRC// / })
|
2015-10-01 03:23:40 +03:00
|
|
|
VET_TEST="${REPO_PATH} ${split_vet[@]/#/${REPO_PATH}/}"
|
2014-05-10 12:42:57 +04:00
|
|
|
|
2014-10-23 22:46:40 +04:00
|
|
|
echo "Checking govet..."
|
2015-08-12 20:53:32 +03:00
|
|
|
go vet $VET_TEST
|
|
|
|
|
|
|
|
echo "Running tests..."
|
|
|
|
go test -timeout 60s -cover $@ ${VET_TEST} --race
|
2014-10-23 22:46:40 +04:00
|
|
|
|
2014-05-10 12:42:57 +04:00
|
|
|
echo "Success"
|