diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2014-01-14 12:26:16 -0800 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-01-14 12:26:16 -0800 |
commit | 61b4af05646a8f014cfb00a5507fec2deb9aafa6 (patch) | |
tree | 498c27d8f0a17ec154378d80276943512276459e | |
parent | 9a7f6f08c1dc0eb0dd91437da8ac429fbafc8a4a (diff) | |
download | pygobject-61b4af05646a8f014cfb00a5507fec2deb9aafa6.tar.gz |
tests: Run PyFlakes and PEP8 only on SUBDIRS
Move PyFlakes and PEP8 checks into check-local of the root Makefile.am. Only
run these tools on selective subdirs of top_srcdir. This fixes a problem
where vpath build directories within the srcdir would contain links to the
source files, causing these tools to run multiple times slowing down the
check process.
-rw-r--r-- | Makefile.am | 21 | ||||
-rw-r--r-- | tests/Makefile.am | 6 |
2 files changed, 20 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index b0623ffb..1ab1b634 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,13 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = 1.7 +# Limit PyFlakes and PEP8 to these directories. +pycheck_dirs = examples gi tests pygtkcompat + # Part of the gi subdirectory is handled with non-recursive make to avoid # py-compile getting confused between gi/types.py and Python's standard # types module. -SUBDIRS = examples gi tests pygtkcompat +SUBDIRS = . $(pycheck_dirs) PLATFORM_VERSION = 3.0 @@ -167,6 +170,22 @@ dist-hook: $(BUILT_EXTRA_DIST) if test -f $$f; then d=.; else d=$(srcdir); fi; \ rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done +# pycheck_subdirs = + +check-local: + @echo " CHECK Pyflakes" $(pycheck_dirs) + @if type pyflakes >/dev/null 2>&1; then \ + (cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \ + else echo "skipped, pyflakes not installed"; \ + fi + @if test -z "$$SKIP_PEP8"; then \ + echo " CHECK PEP8"; \ + if type pep8 >/dev/null 2>&1; then \ + (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124 --repeat --show-source $(pycheck_dirs) ); \ + else echo "skipped, pep8 not installed"; \ + fi; \ + fi + check.gdb: cd tests && $(MAKE) check.gdb diff --git a/tests/Makefile.am b/tests/Makefile.am index 02063d07..e69c2634 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -134,12 +134,6 @@ RUN_TESTS_ENV_VARS= \ # pygtkcompat tests need to be run in a separate process as they # clobber global name space check-local: $(check_LTLIBRARIES:.la=.so) $(test_typelibs) gschemas.compiled - @echo " CHECK Pyflakes" - @if type pyflakes >/dev/null 2>&1; then pyflakes $(top_srcdir); else echo "skipped, pyflakes not installed"; fi - @if test -z "$$SKIP_PEP8"; then \ - echo " CHECK PEP8"; \ - if type pep8 >/dev/null 2>&1; then pep8 --ignore=E501,E123,E124 --repeat --show-source $(top_srcdir); else echo "skipped, pep8 not installed"; fi; \ - fi export `$(DBUS_LAUNCH)` && \ $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd $(srcdir)/runtests.py; rc=$$?; \ [ "$$rc" -ne 0 ] || [ -n "$$TEST_NAMES" ] || { TEST_NAMES=compat_test_pygtk $(RUN_TESTS_ENV_VARS) $(EXEC_NAME) $(PYTHON) -Wd -Werror::PendingDeprecationWarning -Werror::DeprecationWarning -Werror::RuntimeWarning $(srcdir)/runtests.py; rc=$$?; }; \ |