cloudinit/test

45 lines
784 B
Plaintext
Raw Normal View History

2014-03-05 04:50:54 +04:00
#!/bin/bash -e
2014-05-10 12:42:57 +04:00
source ./build
SRC="
config
config/validate
datasource
datasource/configdrive
datasource/file
datasource/metadata
datasource/metadata/cloudsigma
datasource/metadata/digitalocean
datasource/metadata/ec2
datasource/metadata/openstack
datasource/proc_cmdline
datasource/test
datasource/url
2015-05-19 07:10:34 +03:00
datasource/vmware
datasource/waagent
initialize
network
pkg
system
.
"
2014-03-05 04:50:54 +04:00
echo "Checking gofix..."
go tool fix -diff $SRC
2014-05-10 12:42:57 +04:00
echo "Checking gofmt..."
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..."
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"