forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.39 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
GO := go
GOFLAGS :=
PKG := ./...
STRESSFLAGS :=
TAGS := invariants
TESTS := .
.PHONY: all
all:
@echo usage:
@echo " make test"
@echo " make testrace"
@echo " make stress"
@echo " make stressrace"
@echo " make stressmeta"
@echo " make mod-update"
@echo " make clean"
.PHONY: test
test:
GO111MODULE=off ${GO} test -tags '$(TAGS)' ${GOFLAGS} -run ${TESTS} ${PKG}
.PHONY: testrace
testrace: GOFLAGS += -race
testrace: test
.PHONY: stress stressrace
stressrace: GOFLAGS += -race
stress stressrace:
GO111MODULE=off ${GO} test -v -tags '$(TAGS)' ${GOFLAGS} -exec 'stress ${STRESSFLAGS}' -run '${TESTS}' -timeout 0 ${PKG}
.PHONY: stressmeta
stressmeta: PKG = ./internal/metamorphic
stressmeta: STRESSFLAGS += -p 1
stressmeta: TESTS = TestMeta$$
stressmeta:
GO111MODULE=off ${GO} test -v -tags '$(TAGS)' ${GOFLAGS} -exec 'stress ${STRESSFLAGS}' -run '${TESTS}' -timeout 0 ${PKG}
.PHONY: generate
generate:
GO111MODULE=off ${GO} generate ${PKG}
# The cmd/pebble/{badger,boltdb,rocksdb}.go files causes various
# cockroach dependencies to be pulled in which is undesirable. Hack
# around this by temporarily moving hiding that file.
mod-update:
mkdir -p cmd/pebble/_bak
mv cmd/pebble/{badger,boltdb,rocksdb}.go cmd/pebble/_bak
GO111MODULE=on ${GO} mod vendor
mv cmd/pebble/_bak/* cmd/pebble && rmdir cmd/pebble/_bak
.PHONY: clean
clean:
rm -f $(patsubst %,%.test,$(notdir $(shell go list ${PKG})))