Source

trac-userscriptservernotes-plugin / GNUmakefile


default: help

msgfmt builds install clean dist rpm update trac restart:
	cd src && $(MAKE) $@
rpm rpm1:
	cd src && $(MAKE) rpm
test unittest check:
	cd src && $(MAKE) $@
test_%:        # run a single unittest by giving the function name
	@ for filename in src/tests/*_test.py ; do echo "$$filename..." \
	;  class=`basename $$filename .py` \
	;  echo  "grep 'def $@' $$filename" \
	;  func1=`grep "def $@" $$filename \
	    | sed -e "s/.*def  *//" -e "s/[(].*//" -e q` \
	;  echo "'$$func1'" \
	;  test -n "$$func1" && break \
	; done \
	; if test -n "$$func1" ; then : \
	;   echo "PYTHONPATH=src  \\" \
	;   echo "python $$filename $$class.$$func1" \
	;   echo "" \
	;         PYTHONPATH=src \
	          python $$filename "$$class.$$func1" \
	; else : \
	;   echo "not found $@ in src/tests"; exit 1 \
	; fi
testlist:      # show available unittest function names (for test_%)
	@ for filename in src/tests/*_test.py ; do : \
	;  class=`basename $$filename .py` \
	;  echo "$$class:" \
	;  cat $$filename \
	     | sed -e "/^ *def test_/!d" -e "s/.*def  *//" -e "s/[(].*//" \
	           -e "s/^/  /" \
	; done 
help:          # shows this help
	@ cat $(MAKEFILE_LIST) | sed -e "/^[.a-z][-a-z0-9 _%]*:/!d" -e "s|: |:        |"

.PHONY: rpm build src