X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=blobdiff_plain;f=Makefile;h=49a17d175543bcff007e62c48c858e26ded38cc4;hp=d02a974a1d11d206418abed71d702964ad521ac7;hb=12139c6090941f67c098bf4387ce00a8503e825e;hpb=71eeef1008cf47c3e60d61ac476777ffec5120c3 diff --git a/Makefile b/Makefile index d02a974..49a17d1 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,47 @@ RPMBUILD = $(PWD)/dist/rpmbuild -all: lint pep8 +all: testdeps lint pep8 test + echo "All tests passed" + +testdeps: + # Determine if test deps are installed + # First, some binaries + which lessc + which pylint + which pep8 + which httpd + which postgres + which openssl + which slapd + # Now, python libraries + python -c 'import openid' + python -c 'import openid_teams' + python -c 'import openid_cla' + python -c 'import cherrypy' + python -c 'import M2Crypto' + python -c 'import lasso' + python -c 'import sqlalchemy' + python -c 'import ldap' + python -c 'import pam' + python -c 'import fedora' + python -c 'import ipapython' + python -c 'import jinja2' + python -c 'import psycopg2' + # And now everything else + ls /usr/share/doc/sssd + ls /usr/lib64/libsss_simpleifp.so.0 + ls /usr/lib64/httpd/modules/mod_wsgi.so + ls /usr/libexec/mod_auth_mellon lint: # Analyze code # don't show recommendations, info, comments, report # W0613 - unused argument # Ignore cherrypy class members as they are dynamically added + # Ignore IPA API class members as they are dynamically added pylint -d c,r,i,W0613 -r n -f colorized \ --notes= \ - --ignored-classes=cherrypy \ + --ignored-classes=cherrypy,API \ ./ipsilon pep8: @@ -25,9 +57,52 @@ ui: less/ipsilon.less less/admin.less # Requires NodeJS less and clear-css packages # Should be removed when lesscpy starts to work properly ui-node: less/ipsilon.less less/admin.less + # Create and minify CSS - lessc --clean-css less/ipsilon.less ui/css/ipsilon.css - lessc --clean-css less/admin.less ui/css/admin.css + #lessc --clean-css less/ipsilon.less ui/css/ipsilon.css + #lessc --clean-css less/admin.less ui/css/admin.css + + #FIXME: temporarily disable clean-css fo deveopment + lessc less/ipsilon.less ui/css/ipsilon.css + lessc less/admin.less ui/css/admin.css + +clean: + rm -fr testdir cscope.out + find ./ -name '*.pyc' -exec rm -f {} \; + +cscope: + git ls-files | xargs pycscope + +lp-test: + pylint -d c,r,i,W0613 -r n -f colorized \ + --notes= \ + --ignored-classes=cherrypy \ + ./tests + pep8 tests + +wrappers: + #rm -fr wrapdir + #mkdir wrapdir + #LD_PRELOAD=libsocket_wrapper.so + #SOCKET_WRAPPER_DIR=wrapdir + #SOCKET_WRAPPER_DEFAULT_IFACE=9 + +tests: wrappers + PYTHONPATH=./ ./tests/tests.py --test=test1 + PYTHONPATH=./ ./tests/tests.py --test=testlogout + PYTHONPATH=./ ./tests/tests.py --test=testnameid + PYTHONPATH=./ ./tests/tests.py --test=testrest + PYTHONPATH=./ ./tests/tests.py --test=attrs + PYTHONPATH=./ ./tests/tests.py --test=trans + PYTHONPATH=./ ./tests/tests.py --test=pgdb + PYTHONPATH=./ ./tests/tests.py --test=fconf + PYTHONPATH=./ ./tests/tests.py --test=ldap + +test: lp-test unittests tests + +unittests: + PYTHONPATH=./ ./ipsilon/tools/saml2metadata.py + PYTHONPATH=./ python ./ipsilon/util/policy.py sdist: python setup.py sdist @@ -46,9 +121,14 @@ rpmdistdir: rpms: rpmroot rpmdistdir sdist cp dist/ipsilon*.tar.gz $(RPMBUILD)/SOURCES/ - rpmbuild --define "_topdir $(RPMBUILD)" -ba contrib/fedora/ipsilon.spec + rpmbuild --define "gittag .git`git rev-parse --short HEAD`" --define "builddate .`date +%Y%m%d%H%M`" --define "_topdir $(RPMBUILD)" -ba contrib/fedora/ipsilon.spec mv $(RPMBUILD)/RPMS/*/ipsilon-*.rpm dist/rpms/ mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/ rm -rf $(RPMBUILD) -rpms: sdist +releaserpms: rpmroot rpmdistdir sdist + cp dist/ipsilon*.tar.gz $(RPMBUILD)/SOURCES/ + rpmbuild --define "_topdir $(RPMBUILD)" -ba contrib/fedora/ipsilon.spec + mv $(RPMBUILD)/RPMS/*/ipsilon-*.rpm dist/rpms/ + mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/ + rm -rf $(RPMBUILD)