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
c9b33f46
Commit
c9b33f46
authored
Jan 18, 2017
by
Vít Novotný
Browse files
made the pylint2 and pylint3 tests faster
parent
1c4ae1d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
c9b33f46
...
...
@@ -2,28 +2,31 @@
IGNORED_PYLINT_TESTS
=
invalid-name missing-docstring
\
redefined-variable-type too-few-public-methods
IGNORED_PYLINT2_TESTS
=
superfluous-parens
IGNORED_PYLINT3_TESTS
=
IGNORED_PYLINT2_TESTS
=
superfluous-parens
duplicate-code
IGNORED_PYLINT3_TESTS
=
duplicate-code
tests
:
# all tests
@
make
-j
3 output pylint2 pylint3
# all ok
# all
tests
ok
output
:
#
testing python script
output
#
python
output
test
@
set
-e
;
\
TEMP
=
`
mktemp
`
;
\
trap
'rm $$TEMP'
EXIT
;
\
for
FILE
in
*
.py
;
do
\
printf
'output test
:\t
%s\n'
"
$$
FILE"
;
\
printf
'
# python
output test
"
%s
"
\n'
"
$$
FILE"
;
\
if
[
-e
"
$$
FILE.out"
]
;
then
\
python
"
$$
FILE"
>
$$
TEMP
;
\
diff
"
$$
FILE.out"
$$
TEMP
;
\
printf
'# python output test "%s" ok\n'
"
$$
FILE"
;
\
else
\
printf
'No output test exists for file "%s".\n'
"
$$
FILE"
;
\
exit
1
;
\
fi
;
\
done
# python output test ok
COMMA
:=
,
EMPTY
:=
...
...
@@ -34,23 +37,15 @@ PYLINT3_OPTIONS=--disable=$(subst $(SPACE),$(COMMA),\
$(IGNORED_PYLINT_TESTS)
$(IGNORED_PYLINT3_TESTS)
)
pylint2
:
# testing python scripts via pylint2
@
for
FILE
in
*
.py
;
do
\
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
;
\
fi
;
\
done
# pylint2 test
@
if
!
REPORT
=
"
$$
(pylint
$(PYLINT2_OPTIONS)
*.py 2>&1)"
;
then
\
printf
"%s
\n
"
"
$$
REPORT"
;
\
fi
# pylint2 test ok
pylint3
:
# testing python scripts via pylint3
@
for
FILE
in
*
.py
;
do
\
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
;
\
fi
;
\
done
# pylint3 test
@
if
!
REPORT
=
"
$$
(pylint3
$(PYLINT3_OPTIONS)
*.py 2>&1)"
;
then
\
printf
"%s
\n
"
"
$$
REPORT"
;
\
fi
# pylint3 test ok
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