-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·58 lines (45 loc) · 1.25 KB
/
Makefile
File metadata and controls
executable file
·58 lines (45 loc) · 1.25 KB
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
55
56
57
58
CI := $(shell echo ${CI})
WORKERS ?= 2
WORKERS_COMMAND := $(if ${WORKERS},-n ${WORKERS} --dist=loadscope,)
DURATIONS ?= 10
DURATIONS_COMMAND := $(if ${DURATIONS},--durations=${DURATIONS},)
RANGE_DIR ?=
TEST_DIR ?= $(if ${RANGE_DIR},${RANGE_DIR},./ding)
COV_DIR ?= $(if ${RANGE_DIR},${RANGE_DIR},./ding)
FORMAT_DIR ?= $(if ${RANGE_DIR},${RANGE_DIR},./ding)
PLATFORM_TEST_DIR ?= $(if ${RANGE_DIR},${RANGE_DIR},./ding/entry/tests/)
docs:
$(MAKE) -C ./ding/docs html
unittest:
pytest ${TEST_DIR} \
--cov-report=xml \
--cov-report term-missing \
--cov=${COV_DIR} \
${WORKERS_COMMAND} \
-sv -m unittest \
algotest:
pytest ${TEST_DIR} \
${DURATIONS_COMMAND} \
-sv -m algotest
cudatest:
pytest ${TEST_DIR} \
-sv -m cudatest
platformtest:
pytest ${PLATFORM_TEST_DIR} \
--cov-report term-missing \
--cov=${COV_DIR} \
${WORKERS_COMMAND} \
-sv -m unittest \
benchmark:
pytest ${TEST_DIR} \
--durations=0 \
-sv -m benchmark
test: unittest # just for compatibility, can be changed later
cpu_test: unittest algotest benchmark
all_test: unittest algotest cudatest benchmark
format:
yapf --in-place --recursive -p --verbose --style .style.yapf ${FORMAT_DIR}
format_test:
bash format.sh ./ding --test
flake_check:
flake8 ./ding