Commit 63541b3d authored by Vít Novotný's avatar Vít Novotný
Browse files

added parallel make support

parent dd747655
.PHONY: tests output pylint2 pylint3
IGNORED_PYLINT_TESTS=invalid-name,missing-docstring,redefined-variable-type,too-few-public-methods
IGNORED_PYLINT_TESTS=invalid-name missing-docstring \
redefined-variable-type too-few-public-methods
IGNORED_PYLINT2_TESTS=superfluous-parens
IGNORED_PYLINT3_TESTS=
tests: output pylint2 pylint3
tests:
@make -j 3 output pylint2 pylint3
# all ok
output:
# testing python script output
@set -e;\
@set -e; \
TEMP=`mktemp`; \
trap 'rm $$TEMP' EXIT; \
for FILE in *.py; do \
printf '%s\n' "$$FILE"; \
printf 'output test:\t%s\n' "$$FILE"; \
if [ -e "$$FILE.out" ]; then \
python "$$FILE" > $$TEMP; \
diff "$$FILE.out" $$TEMP; \
......@@ -22,11 +25,19 @@ output:
fi; \
done
COMMA:=,
EMPTY:=
SPACE:=$(EMPTY) $(EMPTY)
PYLINT2_OPTIONS=--disable=$(subst $(SPACE),$(COMMA),\
$(IGNORED_PYLINT_TESTS) $(IGNORED_PYLINT2_TESTS))
PYLINT3_OPTIONS=--disable=$(subst $(SPACE),$(COMMA),\
$(IGNORED_PYLINT_TESTS) $(IGNORED_PYLINT3_TESTS))
pylint2:
# testing the python scripts via pylint
# testing python scripts via pylint2
@for FILE in *.py; do \
printf '%s\n' "$$FILE"; \
REPORT="$$(pylint --disable=$(IGNORED_PYLINT_TESTS),$(IGNORED_PYLINT2_TESTS) "$$FILE" 2>&1)"; \
printf 'pylint2 test:\t%s\n' "$$FILE"; \
REPORT="$$(pylint $(PYLINT2_OPTIONS) "$$FILE" 2>&1)"; \
if ! [ $$? = 0 ]; then \
printf '%s\nThe above report is for file "%s".\n' "$$REPORT" "$$FILE"; \
exit 1; \
......@@ -34,10 +45,10 @@ pylint2:
done
pylint3:
# testing the python scripts via pylint3
# testing python scripts via pylint3
@for FILE in *.py; do \
printf '%s\n' "$$FILE"; \
REPORT="$$(pylint3 --disable=$(IGNORED_PYLINT_TESTS) "$$FILE" 2>&1)"; \
printf 'pylint3 test:\t%s\n' "$$FILE"; \
REPORT="$$(pylint3 $(PYLINT3_OPTIONS) "$$FILE" 2>&1)"; \
if ! [ $$? = 0 ]; then \
printf '%s\nThe above report is for file "%s".\n' "$$REPORT" "$$FILE"; \
exit 1; \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment