forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
188 lines (143 loc) · 5.39 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Short doc about the commands (please keep in sync with cmd/README for now):
# ------------------------ User commands -----------------------
# gnokey Key manipulation, also general interaction with gnoland
# gnoland Runs the blockchain node
# gnotxport Importing/exporting transactions from local blockchain node storage
# website Serves gno website, along with user-defined content
# logos Intended to be used as a browser
#
# ---------------------- Developer commands -------------------
# gnoscan Dumps imports from specified file’s AST
# genproto Helper for generating .proto implementations
# gnofaucet Serves GNOT faucet
# gnodev Handy tool for developing gno packages & realms
# Dist suite
.PHONY: logos goscan gnoland gnokey gnofaucet logos reset gnoweb gnotxport
all: build
build: gnoland gnokey gnodev goscan logos gnoweb gnotxport gnofaucet
install: install_gnodev install_gnokey
reset:
rm -rf testdir
make
tools:
go build -o build/logjack ./pkgs/autofile/cmd
gnoland:
@echo "Building gnoland"
go build -o build/gnoland ./cmd/gnoland
gnokey:
@echo "Building gnokey"
go build -o build/gnokey ./cmd/gnokey
gnodev:
@echo "Building gnodev"
go build -o build/gnodev ./cmd/gnodev
install_gnokey:
@echo "Installing gnokey"
go install ./cmd/gnokey
install_gnodev:
@echo "Installing gnodev"
go install ./cmd/gnodev
gnofaucet:
@echo "Building gnofaucet"
go build -o build/gnofaucet ./cmd/gnofaucet
# goscan scans go code to determine its AST
goscan:
@echo "Building goscan"
go build -o build/goscan ./cmd/goscan
gnoweb:
@echo "Building website"
go build -o build/website ./gnoland/website
gnotxport:
@echo "Building gnotxport"
go build -o build/gnotxport ./cmd/gnotxport
logos:
@echo "building logos"
go build -o build/logos ./misc/logos/cmd/logos.go
clean:
rm -rf build
examples.precompile: install_gnodev
go run ./cmd/gnodev precompile --verbose ./examples
examples.build: install_gnodev examples.precompile
go run ./cmd/gnodev build --verbose ./examples
########################################
# Formatting, linting.
.PHONY: fmt
fmt:
go run -modfile ./misc/devdeps/go.mod mvdan.cc/gofumpt -w .
go run -modfile ./misc/devdeps/go.mod mvdan.cc/gofumpt -w `find stdlibs examples -name "*.gno"`
.PHONY: lint
lint:
golangci-lint run --config .golangci.yaml
########################################
# Test suite
.PHONY: test test.go test.go1 test.go2 test.go3 test.go4 test.gno test.filesNative test.filesStdlibs test.realm test.packages test.flappy test.packages0 test.packages1 test.packages2 test.docker-integration
test: test.gno test.go test.flappy
@echo "Full test suite finished."
test.gno: test.filesNative test.filesStdlibs test.packages test.examples
go test tests/*.go -v -run "TestFileStr"
go test tests/*.go -v -run "TestSelectors"
test.docker-integration:
go test -count=1 -v ./tests/docker-integration
test.flappy:
# flappy tests should work "sometimes" (at least once)
TEST_STABILITY=flappy go run -modfile ./misc/devdeps/go.mod moul.io/testman test -test.v -timeout=20m -retry=10 -run ^TestFlappy \
./pkgs/bft/consensus ./pkgs/bft/blockchain ./pkgs/bft/mempool ./pkgs/p2p ./pkgs/bft/privval
test.go: test.go1 test.go2 test.go3 test.go4
test.go1:
# test most of pkgs/* except amino and bft.
# -p 1 shows test failures as they come
# maybe another way to do this?
go test `go list ./pkgs/... | grep -v pkgs/amino/ | grep -v pkgs/bft/` -v -p 1 -timeout=30m
test.go2:
# test amino.
go test ./pkgs/amino/... -v -p 1 -timeout=30m
test.go3:
# test bft.
go test ./pkgs/bft/... -v -p 1 -timeout=30m
test.go4:
go test ./cmd/gnodev ./cmd/gnoland -v -p 1 -timeout=30m
test.filesNative:
go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m
test.filesNative.sync:
go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m --update-golden-tests
test.filesStdlibs:
go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m
test.filesStdlibs.sync:
go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m --update-golden-tests
test.realm:
go test tests/*.go -v -run "TestFiles/^zrealm" --timeout 30m
test.packages: test.packages0 test.packages1 test.packages2
test.packages0:
go test tests/*.go -v -run "TestPackages/(bufio|crypto|encoding|errors|internal|io|math|sort|std|stdshim|strconv|strings|testing|unicode)" --timeout 30m
test.packages1:
go test tests/*.go -v -run "TestPackages/regexp" --timeout 30m
test.packages2:
go test tests/*.go -v -run "TestPackages/bytes" --timeout 30m
test.examples:
go run ./cmd/gnodev test --verbose ./examples
test.examples.sync:
go run ./cmd/gnodev test --verbose --update-golden-tests ./examples
# Code gen
stringer:
stringer -type=Kind
stringer -type=Op
stringer -type=TransCtrl
stringer -type=TransField
stringer -type=VPType
stringer -type=Word
genproto:
rm -rf proto/*
find pkgs | grep -v "^pkgs\/amino" | grep "\.proto" | xargs rm
find pkgs | grep -v "^pkgs\/amino" | grep "pbbindings" | xargs rm
find pkgs | grep -v "^pkgs\/amino" | grep "pb.go" | xargs rm
@rm gno.proto || true
@rm pbbindings.go || true
@rm gno.pb.go || true
go run cmd/genproto/genproto.go
genproto2:
rm -rf proto/*
#find pkgs | grep -v "^pkgs\/amino" | grep "\.proto" | xargs rm
find pkgs | grep -v "^pkgs\/amino" | grep "pbbindings" | xargs rm
find pkgs | grep -v "^pkgs\/amino" | grep "pb.go" | xargs rm
#@rm gno.proto || true
@rm pbbindings.go || true
@rm gno.pb.go || true