-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
86 lines (69 loc) · 2.26 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
76
77
78
79
80
81
82
83
84
85
86
ifeq ($(shell hostname),samosa) # Ben's MacBook Air M1
PY = python3
BROWSER = open
MYPY = mypy
else
#PY = python3.7
PY = python3.9
BROWSER = google-chrome
MYPY = mypy --python-version 3.9
endif
MYPY_FLAGS = --show-error-codes --allow-redefinition
# Type 'make' to run unit tests and then run current program in interactive
# mode.
ut_and_go: ut current
# Convenience target for "do whatever I'm currently working on".
current:
$(PY) -i numbo6.py
test: ut at
# Static typecheck. Requires that 'mypy' be installed.
mypy:
@echo -e \\n\\n\\n\\n\\n
#$(MYPY) Numbo1a.py
$(MYPY) $(MYPY_FLAGS) Numbo1a.py testSlipnet2.py atestEquation.py testFARGModel.py
# Unit tests for FARGish2. This will be obsolete once FARGModel.py and its
# mates are done.
ut2:
$(PY) -m unittest -v testSlipnet.py testFARGish2.py testPropagator.py testNumbo.py
# Run all unit tests. 'ut' should be set to this. It's only here as a temporary
# measure before clearing out a bunch of obsolete unit tests.
full_ut:
$(PY) -m unittest -v
ut:
$(PY) -m unittest -v testFARGModel testSlipnet testNumberMatcher testGraph2 testEquation test_sa testSlipnet2 test_util
lut:
$(PY) -m unittest -v `cat LIVETEST`
# Convenience target for single test current being worked on
u:
$(PY) -m unittest -v test_util
#$(PY) -m unittest -v testSlipnet2.TestSlipnet
#$(PY) -m unittest -v testFARGModel.TestFARGModel.test_make_table_consume
#$(PY) -m unittest -v testEquation.TestEquation
#$(PY) -m unittest -v testGraph2.TestGraph.test_doubled_graph
# Acceptance tests
at:
#$(PY) -m unittest -v atest*.py
# TODO Restore previous line after old atests are removed.
$(PY) -m unittest -v atestEquation
a:
#$(PY) -m unittest -v atest_numbo.NumboTest.test_456_1
$(PY) -m unittest -v atestEquation
# line counts
lc: clean
@echo -n 'LIVE: '
@wc -l `cat LIVE` | tail -1 | awk '{print $$1}'
@echo -n 'LIVETEST: '
@wc -l `cat LIVETEST` | tail -1 | awk '{print $$1}'
@echo -n '*.py: '
@wc -l *.py | tail -1 | awk '{print $$1}'
# test coverage
# 'make ct bc' to generate coverage data and see it in a browser
ct coverage:
coverage run -m unittest
bc browse-coverage:
coverage html && $(BROWSER) htmlcov/index.html
tags:
ctags *.py # fargcyto.js # force-directed*.js
clean:
rm -f *.gen.py
.PHONY: ut tags clean test current ut_and_go lc