github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/tm2/pkg/iavl/Makefile (about)

     1  GOTOOLS := github.com/golangci/golangci-lint/cmd/golangci-lint
     2  
     3  PDFFLAGS := -pdf --nodefraction=0.1
     4  
     5  LDFLAGS := -ldflags "-X TENDERMINT_IAVL_COLORS_ON=on"
     6  
     7  all: lint test install
     8  
     9  
    10  
    11  install:
    12  ifeq ($(COLORS_ON),)
    13  	go install ./cmd/iaviewer
    14  else
    15  	go install $(LDFLAGS) ./cmd/iaviewer
    16  endif
    17  
    18  test:
    19  	go test -v --race
    20  
    21  tools:
    22  	go get -v $(GOTOOLS)
    23  
    24  # look into .golangci.yml for enabling / disabling linters
    25  lint:
    26  	@echo "--> Running linter"
    27  	@golangci-lint run
    28  
    29  # bench is the basic tests that shouldn't crash an aws instance
    30  bench:
    31  	cd benchmarks && \
    32  		go test -bench=RandomBytes . && \
    33  		go test -bench=Small . && \
    34  		go test -bench=Medium . && \
    35  		go test -bench=BenchmarkMemKeySizes .
    36  
    37  # fullbench is extra tests needing lots of memory and to run locally
    38  fullbench:
    39  	cd benchmarks && \
    40  		go test -bench=RandomBytes . && \
    41  		go test -bench=Small . && \
    42  		go test -bench=Medium . && \
    43  		go test -timeout=30m -bench=Large . && \
    44  		go test -bench=Mem . && \
    45  		go test -timeout=60m -bench=LevelDB .
    46  
    47  
    48  # note that this just profiles the in-memory version, not persistence
    49  profile:
    50  	cd benchmarks && \
    51  		go test -bench=Mem -cpuprofile=cpu.out -memprofile=mem.out . && \
    52  		go tool pprof ${PDFFLAGS} benchmarks.test cpu.out > cpu.pdf && \
    53  		go tool pprof --alloc_space ${PDFFLAGS} benchmarks.test mem.out > mem_space.pdf && \
    54  		go tool pprof --alloc_objects ${PDFFLAGS} benchmarks.test mem.out > mem_obj.pdf
    55  
    56  explorecpu:
    57  	cd benchmarks && \
    58  		go tool pprof benchmarks.test cpu.out
    59  
    60  exploremem:
    61  	cd benchmarks && \
    62  		go tool pprof --alloc_objects benchmarks.test mem.out
    63  
    64  delve:
    65  	dlv test ./benchmarks -- -test.bench=.
    66  
    67  .PHONY: lint test tools install delve exploremem explorecpu profile fullbench bench