|
3 | 3 | @echo "Available make commands:" |
4 | 4 | @cat Makefile | grep '^[a-z]' | grep -v '=' | cut -d: -f1 | sort | sed 's/^/ /' |
5 | 5 |
|
| 6 | +rundep=go run -modfile ../misc/devdeps/go.mod |
| 7 | + |
6 | 8 | .PHONY: build |
7 | 9 | build: |
8 | 10 | go build -o build/gno ./cmd/gno |
|
22 | 24 |
|
23 | 25 | ######################################## |
24 | 26 | # Test suite |
25 | | -.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 |
26 | | -test: test.gno test.go test.flappy |
| 27 | +.PHONY: test |
| 28 | +test: _test.cmd _test.pkg _test.gnolang |
27 | 29 | @echo "Full test suite finished." |
28 | 30 |
|
29 | | -test.gno: test.filesNative test.filesStdlibs test.packages |
30 | | - go test tests/*.go -v -run "TestFileStr" |
31 | | - go test tests/*.go -v -run "TestSelectors" |
32 | | - |
33 | | -test.go: test.go1 test.go2 test.go3 test.go4 |
34 | | - |
35 | | -test.go1: |
36 | | - # test most of pkgs/* except amino and bft. |
37 | | - # -p 1 shows test failures as they come |
38 | | - # maybe another way to do this? |
39 | | - go test `go list ./pkgs/... | grep -v pkgs/amino/ | grep -v pkgs/bft/` -v -p 1 -timeout=30m |
| 31 | +.PHONY: _test.cmd |
| 32 | +_test.cmd: |
| 33 | + go test ./cmd/... -v -p 1 -timeout=30m |
40 | 34 |
|
41 | | -test.go2: |
42 | | - # test amino. |
43 | | - go test ./pkgs/amino/... -v -p 1 -timeout=30m |
| 35 | +.PHONY: test.pkg |
| 36 | +test.pkg: |
| 37 | + go test ./pkg/... -v -p 1 -timeout=30m |
44 | 38 |
|
45 | | -test.go3: |
46 | | - # test bft. |
47 | | - go test ./pkgs/bft/... -v -p 1 -timeout=30m |
48 | | - |
49 | | -test.go4: |
50 | | - go test ./cmd/gnodev ./cmd/gnoland -v -p 1 -timeout=30m |
51 | | - |
52 | | -test.filesNative: |
| 39 | +.PHONY: _test.gnolang |
| 40 | +_test.gnolang: _test.gnolang.native _test.gnolang.stdlibs _test.gnolang.realm _test.gnolang.pkg0 _test.gnolang.pkg1 _test.gnolang.pkg2 _test.gnolang.other |
| 41 | +_test.gnolang.other: |
| 42 | + go test tests/*.go -v -run "TestFileStr" |
| 43 | + go test tests/*.go -v -run "TestSelectors" |
| 44 | +_test.gnolang.native: |
53 | 45 | go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m |
54 | | - |
55 | | -test.filesNative.sync: |
| 46 | +_test.gnolang.native.sync: |
56 | 47 | go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m --update-golden-tests |
57 | | - |
58 | | -test.filesStdlibs: |
| 48 | +_test.gnolang.stdlibs: |
59 | 49 | go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m |
60 | | - |
61 | | -test.filesStdlibs.sync: |
| 50 | +_test.gnolang.stdlibs.sync: |
62 | 51 | go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m --update-golden-tests |
63 | | - |
64 | | -test.realm: |
| 52 | +_test.gnolang.realm: |
65 | 53 | go test tests/*.go -v -run "TestFiles/^zrealm" --timeout 30m |
66 | | - |
67 | | -test.packages: test.packages0 test.packages1 test.packages2 |
68 | | - |
69 | | -test.packages0: |
| 54 | +_test.gnolang.pkg0: |
70 | 55 | go test tests/*.go -v -run "TestPackages/(bufio|crypto|encoding|errors|internal|io|math|sort|std|stdshim|strconv|strings|testing|unicode)" --timeout 30m |
71 | | - |
72 | | -test.packages1: |
| 56 | +_test.gnolang.pkg1: |
73 | 57 | go test tests/*.go -v -run "TestPackages/regexp" --timeout 30m |
74 | | - |
75 | | -test.packages2: |
| 58 | +_test.gnolang.pkg2: |
76 | 59 | go test tests/*.go -v -run "TestPackages/bytes" --timeout 30m |
77 | 60 |
|
78 | 61 | # Code gen |
| 62 | +stringer_cmd=$(rundep) golang.org/x/tools/cmd/stringer |
79 | 63 | stringer: |
80 | | - stringer -type=Kind |
81 | | - stringer -type=Op |
82 | | - stringer -type=TransCtrl |
83 | | - stringer -type=TransField |
84 | | - stringer -type=VPType |
85 | | - stringer -type=Word |
86 | | - |
87 | | -genproto: |
88 | | - rm -rf proto/* |
89 | | - find pkgs | grep -v "^pkgs\/amino" | grep "\.proto" | xargs rm |
90 | | - find pkgs | grep -v "^pkgs\/amino" | grep "pbbindings" | xargs rm |
91 | | - find pkgs | grep -v "^pkgs\/amino" | grep "pb.go" | xargs rm |
92 | | - @rm gno.proto || true |
93 | | - @rm pbbindings.go || true |
94 | | - @rm gno.pb.go || true |
95 | | - go run cmd/genproto/genproto.go |
96 | | - |
97 | | -genproto2: |
98 | | - rm -rf proto/* |
99 | | - #find pkgs | grep -v "^pkgs\/amino" | grep "\.proto" | xargs rm |
100 | | - find pkgs | grep -v "^pkgs\/amino" | grep "pbbindings" | xargs rm |
101 | | - find pkgs | grep -v "^pkgs\/amino" | grep "pb.go" | xargs rm |
102 | | - #@rm gno.proto || true |
103 | | - @rm pbbindings.go || true |
104 | | - @rm gno.pb.go || true |
| 64 | + $(stringer_cmd) -type=Kind ./pkg/gnolang |
| 65 | + $(stringer_cmd) -type=Op ./pkg/gnolang |
| 66 | + $(stringer_cmd) -type=TransCtrl ./pkg/gnolang |
| 67 | + $(stringer_cmd) -type=TransField ./pkg/gnolang |
| 68 | + $(stringer_cmd) -type=VPType ./pkg/gnolang |
| 69 | + $(stringer_cmd) -type=Word ./pkg/gnolang |
| 70 | + |
| 71 | +# genproto: |
| 72 | +# see top-level Makefile. |
0 commit comments