-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile
67 lines (52 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
# Makefile for UVM-Python. Mainly used for running tests,
# coverage and linting.
NPROCS = $(shell grep -c 'processor' /proc/cpuinfo)
MAKEFLAGS += -j$(NPROCS)
ifeq ($(TEST), )
UNIT_ARGS = unit/*.py
else
UNIT_ARGS = unit.$(TEST)
endif
test: test-unit test-minimal test-simple test-integrated test-sim-integration
find test/examples -name results*.xml -exec cat {} \; > results_$(SIM).log
bash ci/check_errors.sh
test-minimal:
make -C test/examples/minimal
test-simple:
make -C test/examples/simple
test-integrated:
ifneq ($(SIM), verilator)
make -C test/examples/integrated
endif
test-unit:
python -m unittest $(UNIT_ARGS)
test-sim-integration:
make -C test/sim_integration MODULE=test_uvm_events
make -C test
lint:
flake8 ./uvm --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./uvm --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Target for unit test coverage
cov:
coverage run --include='src/uvm/**/*.py' -m unittest $(UNIT_ARGS)
coverage html
# Requires coveralls installation, .coveralls.yml and repo_token
coveralls
cov-all:
# Need to run unit tests separately for this
coverage run -m unittest unit/*.py
COVERAGE=1 COVERAGE_RCFILE=$(PWD)/.coveragerc make test
find -name '.coverage.*' | xargs coverage combine # Merge cov from all tests
COVERAGE_RCFILE=$(PWD)/.coveragerc coverage html
# Target to clean up the sim directories, logfiles etc
clean:
find test/ -name 'sim_build*' -exec rm -rf {} \;
find test/ -name 'results*.xml' -exec rm -vf {} \;
stubgen:
stubgen .venv/lib/python3.7/site-packages/cocotb_coverage
stubgen ../cocotb/cocotb
typecheck:
mypy src ./out/*
pytype:
pytype --config=./pytype.cfg
.PHONY: test test-minimal test-simple test-integrated test-unit test-sim-integration lint cov cov-all clean stubgen typecheck pytype