-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
51 lines (39 loc) · 1.46 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
MOCKERY_RELEASE=https://github.com/vektra/mockery/releases/download/v2.22.1/mockery_2.22.1_Linux_x86_64.tar.gz
tmp/mockery:
mkdir -p tmp/
cd tmp/ && \
curl -L $(MOCKERY_RELEASE) | tar xvz
mocks: tmp/mockery
tmp/mockery --all --dir core/
test: unit-test architecture-test
ISETTA_PACKAGES=$(shell go list org.samba/isetta/... | egrep -v 'mocks|org.samba.isetta$$')
unit-test: mocks
go clean -testcache
go test -timeout 30s -run ^Test $(ISETTA_PACKAGES) -v -coverprofile tmp/coverage.out
unit-test-with-wsl: mocks
go clean -testcache
go test -timeout 60s -tags wsl -run ^Test $(ISETTA_PACKAGES) -v
# additionally requires user to provide admin credentials for elevated execution test
unit-test-with-wsl-interactive: mocks
go clean -testcache
go test -timeout 60s -tags wsl,interactive -run ^Test $(ISETTA_PACKAGES) -v
coverage: mocks
go clean -testcache
go test -timeout 30s -run ^Test $(ISETTA_PACKAGES) -v -coverprofile=tmp/coverage.out
go tool cover -func tmp/coverage.out
coverage-with-wsl-interactive: mocks
go clean -testcache
go test -timeout 60s -tags wsl,interactive -run ^Test $(ISETTA_PACKAGES) -v -coverprofile=tmp/coverage.out
go tool cover -func tmp/coverage.out
ARCH_GO=~/go/bin/arch-go
architecture-test: $(ARCH_GO)
~/go/bin/arch-go -v
$(ARCH_GO):
unset GOPATH && \
go get github.com/fdaines/arch-go && \
go install github.com/fdaines/arch-go
isetta:
rm -f tmp/isetta
GOOS=linux go build -ldflags="-w -s" -o tmp/isetta .
clean:
rm -rf tmp/ mocks/