forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
129 lines (99 loc) · 3.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
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
########################################
# Dist suite
.PHONY: logos goscan gnoland gnokey gnofaucet logos reset gnoweb
all: gnoland gnokey goscan logos gnoweb
reset:
rm -rf testdir
make
tools:
go build -o build/logjack ./pkgs/autofile/cmd
# The main show (daemon)
gnoland:
@echo "Building gnoland"
go build -o build/gnoland ./cmd/gnoland
# The main show (client)
gnokey:
@echo "Building gnokey"
go build -o build/gnokey ./cmd/gnokey
install_gnokey:
@echo "Installing gnokey"
go install ./cmd/gnokey
install_gnodev:
@echo "Installing gnodev"
go install ./cmd/gnodev
# The faucet (daemon)
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
# Logos is the interface to Gnoland
logos:
@echo "building logos"
go build -o build/logos ./logos/cmd/logos.go
clean:
rm -rf build
examples.precompile: install_gnodev
gnodev precompile ./examples --verbose
examples.build: install_gnodev examples.precompile
gnodev build ./examples --verbose
########################################
# Test suite
.PHONY: test test.go test.go1 test.go2 test.go3 test.gno test.files1 test.files2 test.realm test.packages test.flappy
test: test.gno test.go test.flappy
@echo "Full test suite finished."
test.gno: test.files1 test.files2 test.realm test.packages test.examples
go test tests/*.go -v -run "TestFileStr"
go test tests/*.go -v -run "TestSelectors"
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
test.go: test.go1 test.go2 test.go3
test.go1:
# test most of pkgs/* except amino and bft.
go test . -v
# -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.files1:
go test tests/*.go -v -test.short -run "TestFiles1/" --timeout 30m
test.files2:
go test tests/*.go -v -test.short -run "TestFiles2/" --timeout 30m
test.realm:
go test tests/*.go -v -run "TestFiles/^zrealm" --timeout 30m
test.packages:
go test tests/*.go -v -run "TestPackages" --timeout 30m
test.examples:
go run ./cmd/gnodev test ./examples
# Code gen
stringer:
stringer -type=Op
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