github.com/petermattis/pebble@v0.0.0-20190905164901-ab51a2166067/Makefile (about)

     1  GO := go
     2  GOFLAGS :=
     3  PKG := ./...
     4  BENCH_PKGS := internal/arenaskl internal/batchskl internal/record sstable .
     5  STRESSFLAGS :=
     6  TESTS := .
     7  BUILDER := ../../cockroachdb/cockroach/build/builder.sh
     8  
     9  .PHONY: all
    10  all:
    11  	@echo usage:
    12  	@echo "  make test"
    13  	@echo "  make testrace"
    14  	@echo "  make stress"
    15  	@echo "  make stressrace"
    16  	@echo "  make bench"
    17  	@echo "  make clean"
    18  
    19  .PHONY: test
    20  test:
    21  	${GO} test ${GOFLAGS} -run ${TESTS} ${PKG}
    22  
    23  .PHONY: test
    24  test-linux:
    25  	${BUILDER} ${GO} test ${GOFLAGS} -run ${TESTS} $(shell go list ${PKG})
    26  
    27  .PHONY: testrace
    28  testrace: GOFLAGS += -race
    29  testrace: test
    30  
    31  .PHONY: stress stressrace
    32  stressrace: GOFLAGS += -race
    33  stress stressrace:
    34  	${GO} test -v ${GOFLAGS} -exec 'stress ${STRESSFLAGS}' -run "${TESTS}" -timeout 0 ${PKG}
    35  
    36  .PHONY: bench
    37  bench: GOFLAGS += -timeout 1h
    38  bench: $(patsubst %,%.bench,$(if $(findstring ./...,${PKG}),${BENCH_PKGS},${PKG}))
    39  
    40  internal/arenaskl.bench: GOFLAGS += -cpu 1,8
    41  
    42  %.bench:
    43  	${GO} test -run - -bench . -count 10 ${GOFLAGS} ./$* 2>&1 | tee $*/bench.txt.new
    44  
    45  .PHONY: clean
    46  clean:
    47  	rm -f $(patsubst %,%.test,$(notdir $(shell go list ${PKG})))