-
Notifications
You must be signed in to change notification settings - Fork 235
/
Makefile
43 lines (31 loc) · 884 Bytes
/
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
SHELL ?= bash
CPU_CORES ?= $(shell nproc)
PARALLEL_FLAGS ?= --halt-on-error 2 --jobs=$(CPU_CORES) -v -u
TEST_FLAGS ?= -v -failfast -race -timeout 20m
UPPER_DB_LOG ?= WARN
export TEST_FLAGS
export PARALLEL_FLAGS
export UPPER_DB_LOG
test: go-test-internal test-adapters
benchmark: go-benchmark-internal
go-benchmark-%:
go test -v -benchtime=500ms -bench=. ./$*/...
go-test-%:
go test -v ./$*/...
test-adapters: \
test-adapter-postgresql \
test-adapter-cockroachdb \
test-adapter-mysql \
test-adapter-mssql \
test-adapter-sqlite \
test-adapter-ql \
test-adapter-mongo
test-adapter-%:
($(MAKE) -C adapter/$* test-extended || exit 1)
test-generic:
export TEST_FLAGS="-run TestGeneric"; \
$(MAKE) test-adapters
goimports:
for FILE in $$(find -name "*.go" | grep -v vendor); do \
goimports -w $$FILE; \
done