-
Notifications
You must be signed in to change notification settings - Fork 124
/
Makefile
52 lines (38 loc) · 1023 Bytes
/
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
NAME:=gosnowflake
VERSION:=$(shell git describe --tags --abbrev=0)
REVISION:=$(shell git rev-parse --short HEAD)
COVFLAGS:=
## Run fmt, lint and test
all: fmt lint cov
include gosnowflake.mak
## Run tests
test_setup: test_teardown
python3 ci/scripts/hang_webserver.py 12345 &
test_teardown:
kill -9 $$(ps -ewf | grep hang_webserver | grep -v grep | awk '{print $$2}') || true
test: deps test_setup
./ci/scripts/execute_tests.sh
## Run Coverage tests
cov:
make test COVFLAGS="-coverprofile=coverage.txt -covermode=atomic"
## Lint
lint: clint
## Format source codes
fmt: cfmt
@for c in $$(ls cmd); do \
(cd cmd/$$c; make fmt); \
done
## Install sample programs
install:
for c in $$(ls cmd); do \
(cd cmd/$$c; GOBIN=$$GOPATH/bin go install $$c.go); \
done
## Build fuzz tests
fuzz-build:
for c in $$(ls | grep -E "fuzz-*"); do \
(cd $$c; make fuzz-build); \
done
## Run fuzz-dsn
fuzz-dsn:
(cd fuzz-dsn; go-fuzz -bin=./dsn-fuzz.zip -workdir=.)
.PHONY: setup deps update test lint help fuzz-dsn