forked from dmacvicar/terraform-provider-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
LDFLAGS += -X main.version=$$(git describe --always --abbrev=40 --dirty)
# default args for tests
TEST_ARGS_DEF := -covermode=count -coverprofile=profile.cov
default: build
terraform-provider-libvirt:
go build -ldflags "${LDFLAGS}"
build: fmt-check lint-check vet-check terraform-provider-libvirt
install:
go install -ldflags "${LDFLAGS}"
# unit tests
# usage:
# - run all the unit tests: make test
# - run some particular test: make test TEST_ARGS="-run TestAccLibvirtDomain_Cpu"
test:
go test -v $(TEST_ARGS_DEF) $(TEST_ARGS) ./libvirt
# acceptance tests
# usage:
#
# - run all the acceptance tests:
# make testacc
#
# - run some particular test:
# make testacc TEST_ARGS="-run TestAccLibvirtDomain_Cpu"
#
# - run all the network test with a verbose loglevel:
# TF_LOG=DEBUG make testacc TEST_ARGS="-run TestAccLibvirtNet*"
#
testacc:
./travis/run-tests-acceptance $(TEST_ARGS)
vet-check:
go vet ./libvirt
lint-check:
go run golang.org/x/lint/golint -set_exit_status ./libvirt .
fmt-check:
go fmt ./libvirt .
tf-check:
terraform fmt -write=false -check=true -diff=true examples/
clean:
rm -f terraform-provider-libvirt
cleanup:
./travis/cleanup.sh
.PHONY: build install test testacc vet-check fmt-check lint-check