-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (48 loc) · 2.1 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
68
69
70
71
PYTHON_PACKAGES = cobrafuzz/*.py tests/*.py tests/**/*.py examples/**/*.py
PYTHON ?= python3
PYTEST = $(PYTHON) -m pytest
all: check test
check: check_ruff check_mypy check_black check_kacl check_dead_code check_todo
check_ruff: .devel_installed
ruff check $(PYTHON_PACKAGES)
check_black: .devel_installed
black --check --diff $(PYTHON_PACKAGES)
check_mypy: .devel_installed
mypy $(PYTHON_PACKAGES)
check_kacl: .devel_installed
kacl-cli verify
check_dead_code: .devel_installed
vulture --ignore-names "CobraFuzz" --min-confidence 70 cobrafuzz
check_todo:
grep --line-number --color=auto -e '#\s*TODO.*$$' **/*.py
test: test_unit test_integration test_build test_doc
test_unit: .devel_installed
PYTHONPATH=. timeout -k 30 360 $(PYTEST) -vv --cov-report term:skip-covered --cov-report xml:coverage.xml --cov=cobrafuzz --cov=tests.unit --cov-branch --cov-fail-under=100 tests/unit tests/utils.py
test_integration: .devel_installed
PYTHONPATH=. timeout -k 30 360 $(PYTEST) -vv tests/integration
test_build: .devel_installed
$(PYTHON) -m build
test_doc: .devel_installed
PYTHONPATH=. timeout -k 30 360 $(PYTEST) -vv tests/test_doc.py
install_devel: .devel_installed
.devel_installed: pyproject.toml
pip install -U pip
pip install -e .[devel]
touch $@
format:
ruff check --fix-only $(PYTHON_PACKAGES) | true
black $(PYTHON_PACKAGES)
fuzz-%:
@$(PYTHON) examples/fuzz_$*/fuzz.py --crash-dir examples/fuzz_$*/crashes fuzz --state examples/fuzz_$*/state.json --close-stdout --close-stderr examples/fuzz_$*/seeds
show-%:
@$(PYTHON) examples/fuzz_$*/fuzz.py --crash-dir examples/fuzz_$*/crashes show
prune-%:
@$(PYTHON) examples/fuzz_$*/fuzz.py --crash-dir examples/fuzz_$*/crashes prune
simp-%:
@$(PYTHON) examples/fuzz_$*/fuzz.py --crash-dir examples/fuzz_$*/crashes simp --output-dir examples/fuzz_$*/simplified --max-time 600
clean-%:
@rm -f examples/fuzz_$*/state.json
@rm -f examples/fuzz_$*/crashes/*
clean:
rm -rf dist cobrafuzz.egg-info crashes .devel_installed .ruff_cache build
.PHONY: check check_black check_kacl check_mypy check_ruff test test_build test_integration test_unit test_doc install_devel