-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
75 lines (57 loc) · 1.8 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
72
73
74
75
.DEFAULT_GOAL := help
.PHONY: help
help:
@echo 'Usage: make [setup|develop|pylint|test|benchmark|cover|package|clean]'
.PHONY: setup
setup:
sudo apt-get install -y python3-dev libmpdec-dev lcov
.PHONY: develop
develop:
pip install -e .
.PHONY: pylint
pylint:
pip install pylint
python3 -m pylint src/abysmal/*.py tests/*.py
.PHONY: test
test: develop
@echo '---------------------------------------------'
@echo 'Running tests with $(shell python3 --version)'
@echo '---------------------------------------------'
python3 -m unittest -v tests/test_*.py
.PHONY: benchmark
benchmark: clean develop
@echo '---------------------------------------------'
@echo 'Running benchmarks with $(shell python3 --version)'
@echo '---------------------------------------------'
python3 -m unittest benchmarks/test_*.py
.PHONY: cover
cover: clean
@echo '---------------------------------------------'
@echo 'Running coverage with $(shell python3 --version)'
@echo '---------------------------------------------'
pip install coverage
ABYSMAL_DEBUG=1 ABYSMAL_COVER=1 pip install -e .
mkdir -p build/ccoverage
mkdir -p build/pycoverage
python3 -m coverage run --branch --source 'abysmal' -m unittest tests/test_*.py
python3 -m coverage html -d $(abspath build/pycoverage)
python3 -m coverage report
gcov -b -o $$(find . -wholename './build/*/src/abysmal') src/abysmal/*.c
lcov --capture --directory . --output-file build/ccoverage/coverage.info
genhtml build/ccoverage/coverage.info --output-directory build/ccoverage
.PHONY: package
package: clean
python3 setup.py sdist
.PHONY: clean
clean:
python3 setup.py develop --uninstall
rm -rf \
.coverage \
*.gcov \
build \
dist \
$$(find . -name '__pycache__') \
$$(find . -name '*.py[cod]') \
$$(find . -name '*.so') \
src/*.egg-info \
src/*.egg