forked from CosmWasm/tinyjson
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
87 lines (76 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
all: test
clean:
rm -rf bin
rm -rf tests/*_tinyjson.go
rm -rf benchmark/*_tinyjson.go
build:
go build -o ./bin/tinyjson ./tinyjson
generate: build
bin/tinyjson -stubs \
./tests/snake.go \
./tests/data.go \
./tests/omitempty.go \
./tests/nothing.go \
./tests/named_type.go \
./tests/custom_map_key_type.go \
./tests/embedded_type.go \
./tests/reference_to_pointer.go \
./tests/html.go \
./tests/unknown_fields.go \
./tests/type_declaration.go \
./tests/type_declaration_skip.go \
./tests/members_escaped.go \
./tests/members_unescaped.go \
./tests/intern.go \
./tests/nocopy.go \
./tests/escaping.go
bin/tinyjson -all \
./tests/data.go \
./tests/nothing.go \
./tests/errors.go \
./tests/html.go \
./tests/type_declaration_skip.go
bin/tinyjson \
./tests/nested_easy.go \
./tests/named_type.go \
./tests/custom_map_key_type.go \
./tests/embedded_type.go \
./tests/reference_to_pointer.go \
./tests/key_marshaler_map.go \
./tests/unknown_fields.go \
./tests/type_declaration.go \
./tests/members_escaped.go \
./tests/intern.go \
./tests/nocopy.go \
./tests/escaping.go \
./tests/nested_marshaler.go
bin/tinyjson -snake_case ./tests/snake.go
bin/tinyjson -omit_empty ./tests/omitempty.go
bin/tinyjson -build_tags=use_tinyjson -disable_members_unescape ./benchmark/data.go
bin/tinyjson -disallow_unknown_fields ./tests/disallow_unknown.go
bin/tinyjson -disable_members_unescape ./tests/members_unescaped.go
test: generate
go test \
./tests \
./jlexer \
./gen \
./buffer
golint -set_exit_status ./tests/*_tinyjson.go
# TODO: fix benchmarks to not need float
# cd benchmark && go test -benchmem -tags use_tinyjson -bench .
tiny-generate: build
bin/tinyjson -all -snake_case \
./tiny-tests/cosmwasm.go
tiny-test: tiny-generate
# look into nounsafe later, this uses reflect, so I remove it just in case
go test -v -tags tinyjson_nounsafe ./tiny-tests
@ golint -set_exit_status ./tiny-tests/*_tinyjson.go
@ echo "No files should be listed below:"
@ grep -l encoding/json ./tiny-tests/*.go || true
tiny-bench:
cd tiny-tests && go test -benchmem -bench .
bench-other: generate
cd benchmark && make
bench-python:
benchmark/ujson.sh
.PHONY: clean generate test build