blob: 9d8e033285d09bfc2494846b28069c9f1297d24e [file] [log] [blame]
default: all
# Note: super-init-not-called really should be enabled, but we had to
# disable it for now due to gpylint bug b/18440404. Re-enable the warning
# if that bug gets fixed.
GPYLINT=$(shell \
if which gpylint >/dev/null; then \
echo gpylint \
--disable=g-bad-import-order \
--disable=g-unknown-interpreter \
--disable=super-init-not-called; \
else \
echo 'echo "(gpylint-missing)" >&2'; \
fi \
)
PYTHONPATH:=$(shell /bin/pwd):$(shell /bin/pwd)/../wvtest:$(PYTHONPATH)
all:
@echo "Nothing to do."
# Use a submake here, only because otherwise GNU make (3.81) will not print
# an error about 'test' itself failing if one of the two sub-targets fails.
# Without such output, 'lint' could fail long before test_only fails, and
# the test_only output could scroll off the top of the screen, leaving the
# misleading impression that everything tested successfully.
test:
$(MAKE) test_only lint
test_only: all *_test.py
for d in $(filter %_test.py,$^); do \
echo "Testing $$d"; \
wvtest/wvtest.py $$d; \
done
# For maximum parallelism, we could just have a rule that depends on %.lint
# for all interesting files. But gpylint takes a long time to start up, so
# let's try to batch several files together into each instance to minimize
# the runtime. For added fun, gpylint has bugs if you specify files from
# more than one directory at once, so break it out by directory.
lint: \
report.lint \
sample.lint \
%.lint: all
@$(GPYLINT) $*
clean:
rm -f *~ .*~ *.pyc