-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
65 lines (50 loc) · 2.55 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
# setting the PATH seems only to work in GNUmake not in BSDmake
PATH := ./testenv/bin:$(PATH)
default: dependencies check test
hudson: clean dependencies test statistics coverage
find ./pyjasper/backend/tests/ -name '*.py' | xargs /usr/local/hudorakit/bin/hd_pep8
/usr/local/hudorakit/bin/hd_pylint -f parseable ./pyjasper/backend/tests/
# we can't use tee because it eats the error code from hd_pylint
/usr/local/hudorakit/bin/hd_pylint -f parseable ./pyjasper/backend/tests/ > .pylint.out
printf 'YVALUE=' > .pylint.score
grep "our code has been rated at" < .pylint.out | cut -d '/' -f 1 | cut -d ' ' -f 7 >> .pylint.score
check:
pyflakes pyjasper/backend/webapps/ pyjasper/backend/tests/ pyjasper/backend/*.py pyjasper/*.py
pep8 -r --ignore=E501 pyjasper/backend/webapps/ pyjasper/backend/tests/ pyjasper/backend/*.py pyjasper/*.py
-pylint -iy --max-line-length=110 -d E1101 pyjasper/backend/webapps/ pyjasper/backend/tests/ pyjasper/backend/*.py pyjasper/*.py
# send the jrxml to the pyjasper server and check if what's returned is a PDF
test: dependencies
sh pyjasper/backend/tests/test.sh
#python pyjasper/tests.py
coverage: dependencies
# PYTHONPATH=. python /usr/local/hudorakit/bin/hd_figleaf --ignore-pylibs ./pyjasper/backend/tests/test.sh
# printf '/usr/local/lib/.*\n/opt/.*\ntestenv/.*\n' > figleaf-exclude.txt
# printf '.*manage.py\n.*settings.py\n.*setup.py\n.*urls.py\n' >> figleaf-exclude.txt
# # fix pathnames
# perl -npe "s|`pwd`/||g;" -i.bak .figleaf
# python /usr/local/hudorakit/bin/hd_figleaf2html -d ./coverage -x figleaf-exclude.txt
# echo "Coverage: " `grep -A3 ">totals:<" coverage/index.html|tail -n1|cut -c 9-13|cut -d'<' -f1`
# test `grep -A3 ">totals:<" coverage/index.html|tail -n1|cut -c 9-13|cut -d'.' -f1` -ge 50
# printf 'YVALUE=' > .coverage.score
# grep -A3 ">totals:<" coverage/index.html|tail -n1|cut -c 9-12 >> .coverage.score
echo "THERE SHOULD BE A COVERAGE TEST HERE!!"
dependencies:
virtualenv testenv
pip -q install -E testenv -r ./pyjasper/backend/tests/requirements.txt
statistics:
sloccount --wide --details . | grep -v -E '(testenv|build|.svn)/' | tee .sloccount.sc
build: # doc
python setup.py build sdist
upload: build
python setup.py sdist upload
install: build
sudo python setup.py install
clean:
rm -Rf testenv build dist html test.db pylint.out sloccount.sc pip-log.txt .coverage.score .pylint.score .figleaf
find . -name '*.pyc' -or -name '*.pyo' -delete
#(cd doc; make clean)
doc:
(cd doc; make doc)
.html:
rst2html.py < $< > html/$*.html
.PHONY: doc build clean install upload check