Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vít Novotný
pb016-priklady
Commits
63541b3d
Commit
63541b3d
authored
Jan 17, 2017
by
Vít Novotný
Browse files
added parallel make support
parent
dd747655
Changes
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
63541b3d
.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 pylint
2
@
for
FILE
in
*
.py
;
do
\
printf
'%s\n'
"
$$
FILE"
;
\
REPORT
=
"
$$
(pylint
--disable=
$(IGNORED_PYLINT_TESTS)
,
$(IGNORED_PYLINT2_TEST
S)
"
$$
FILE
" 2>&1)"
;
\
printf
'
pylint2 test:\t
%s\n'
"
$$
FILE"
;
\
REPORT
=
"
$$
(pylint
$(PYLINT2_OPTION
S)
"
$$
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_TEST
S)
"
$$
FILE
" 2>&1)"
;
\
printf
'
pylint3 test:\t
%s\n'
"
$$
FILE"
;
\
REPORT
=
"
$$
(pylint3
$(PYLINT3_OPTION
S)
"
$$
FILE
" 2>&1)"
;
\
if
!
[
$$
?
=
0
]
;
then
\
printf
'%s\nThe above report is for file "%s".\n'
"
$$
REPORT"
"
$$
FILE"
;
\
exit
1
;
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment