-
Notifications
You must be signed in to change notification settings - Fork 234
/
Makefile
49 lines (37 loc) · 1.54 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
all: test install
@echo "Done"
install:
go install github.com/pquerna/ffjson
deps:
fmt:
go fmt github.com/pquerna/ffjson/...
cov:
# TODO: cleanup this make target.
mkdir -p coverage
rm -f coverage/*.html
# gocov test github.com/pquerna/ffjson/generator | gocov-html > coverage/generator.html
# gocov test github.com/pquerna/ffjson/inception | gocov-html > coverage/inception.html
gocov test github.com/pquerna/ffjson/fflib/v1 | gocov-html > coverage/fflib.html
@echo "coverage written"
test-core:
go test -v github.com/pquerna/ffjson/fflib/v1 github.com/pquerna/ffjson/generator github.com/pquerna/ffjson/inception
test: ffize test-core
go test -v github.com/pquerna/ffjson/tests/...
ffize: install
ffjson -force-regenerate tests/ff.go
ffjson -force-regenerate tests/goser/ff/goser.go
ffjson -force-regenerate tests/go.stripe/ff/customer.go
ffjson -force-regenerate -reset-fields tests/types/ff/everything.go
ffjson -force-regenerate tests/number/ff/number.go
lint: ffize
go get github.com/golang/lint/golint
golint --set_exit_status tests/...
bench: ffize all
go test -v -benchmem -bench MarshalJSON github.com/pquerna/ffjson/tests
go test -v -benchmem -bench MarshalJSON github.com/pquerna/ffjson/tests/goser github.com/pquerna/ffjson/tests/go.stripe
go test -v -benchmem -bench UnmarshalJSON github.com/pquerna/ffjson/tests/goser github.com/pquerna/ffjson/tests/go.stripe
clean:
go clean -i github.com/pquerna/ffjson/...
find . -name '*_ffjson.go' -delete
find . -name 'ffjson-inception*' -delete
.PHONY: deps clean test fmt install all