Skip to content

Commit

Permalink
chore: update gnovm makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Manfred Touron <[email protected]>
  • Loading branch information
moul committed Mar 28, 2023
1 parent ea26338 commit 00cfe56
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ proto/*
testdir
pkgs/sdk/vm/_testdata
cmd/gnodev/gnodev
build/*
**/build/
*.tx
*.log.*
*.log
Expand Down
98 changes: 33 additions & 65 deletions gnovm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z]' | grep -v '=' | cut -d: -f1 | sort | sed 's/^/ /'

rundep=go run -modfile ../misc/devdeps/go.mod

.PHONY: build
build:
go build -o build/gno ./cmd/gno
Expand All @@ -22,83 +24,49 @@ fmt:

########################################
# 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
.PHONY: test
test: _test.cmd _test.pkg _test.gnolang
@echo "Full test suite finished."

test.gno: test.filesNative test.filesStdlibs test.packages
go test tests/*.go -v -run "TestFileStr"
go test tests/*.go -v -run "TestSelectors"

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
.PHONY: _test.cmd
_test.cmd:
go test ./cmd/... -v -p 1 -timeout=30m

test.go2:
# test amino.
go test ./pkgs/amino/... -v -p 1 -timeout=30m
.PHONY: test.pkg
test.pkg:
go test ./pkg/... -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:
.PHONY: _test.gnolang
_test.gnolang: _test.gnolang.native _test.gnolang.stdlibs _test.gnolang.realm _test.gnolang.pkg0 _test.gnolang.pkg1 _test.gnolang.pkg2 _test.gnolang.other
_test.gnolang.other:
go test tests/*.go -v -run "TestFileStr"
go test tests/*.go -v -run "TestSelectors"
_test.gnolang.native:
go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m

test.filesNative.sync:
_test.gnolang.native.sync:
go test tests/*.go -v -test.short -run "TestFilesNative/" --timeout 30m --update-golden-tests

test.filesStdlibs:
_test.gnolang.stdlibs:
go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m

test.filesStdlibs.sync:
_test.gnolang.stdlibs.sync:
go test tests/*.go -v -test.short -run 'TestFiles$$/' --timeout 30m --update-golden-tests

test.realm:
_test.gnolang.realm:
go test tests/*.go -v -run "TestFiles/^zrealm" --timeout 30m

test.packages: test.packages0 test.packages1 test.packages2

test.packages0:
_test.gnolang.pkg0:
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:
_test.gnolang.pkg1:
go test tests/*.go -v -run "TestPackages/regexp" --timeout 30m

test.packages2:
_test.gnolang.pkg2:
go test tests/*.go -v -run "TestPackages/bytes" --timeout 30m

# Code gen
stringer_cmd=$(rundep) golang.org/x/tools/cmd/stringer
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
$(stringer_cmd) -type=Kind ./pkg/gnolang
$(stringer_cmd) -type=Op ./pkg/gnolang
$(stringer_cmd) -type=TransCtrl ./pkg/gnolang
$(stringer_cmd) -type=TransField ./pkg/gnolang
$(stringer_cmd) -type=VPType ./pkg/gnolang
$(stringer_cmd) -type=Word ./pkg/gnolang

# genproto:
# see top-level Makefile.
2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/kind_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/op_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/transctrl_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/transfield_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/vptype_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gnovm/pkg/gnolang/word_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 00cfe56

Please sign in to comment.