Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Core
Tor
Commits
796a9b37
Commit
796a9b37
authored
Sep 09, 2019
by
David Goulet
Browse files
Merge branch 'tor-github/pr/1264'
parents
6846d148
380d178e
Changes
10
Show whitespace changes
Inline
Side-by-side
Makefile.am
View file @
796a9b37
...
...
@@ -176,6 +176,7 @@ EXTRA_DIST+= \
scripts/maint/practracker/practracker.py
\
scripts/maint/practracker/practracker_tests.py
\
scripts/maint/practracker/problem.py
\
scripts/maint/practracker/testdata/.may_include
\
scripts/maint/practracker/testdata/a.c
\
scripts/maint/practracker/testdata/b.c
\
scripts/maint/practracker/testdata/ex0-expected.txt
\
...
...
@@ -183,6 +184,7 @@ EXTRA_DIST+= \
scripts/maint/practracker/testdata/ex1-expected.txt
\
scripts/maint/practracker/testdata/ex1.txt
\
scripts/maint/practracker/testdata/ex.txt
\
scripts/maint/practracker/testdata/header.h
\
scripts/maint/practracker/testdata/not_c_file
\
scripts/maint/practracker/test_practracker.sh
\
scripts/maint/practracker/util.py
...
...
changes/ticket31477
0 → 100644
View file @
796a9b37
o Minor features (tests):
- Add integration tests to make sure that practracker gives the outputs
we expect. Closes ticket 31477.
scripts/maint/practracker/exceptions.txt
View file @
796a9b37
...
...
@@ -325,3 +325,12 @@ problem function-size /src/tools/tor-gencert.c:parse_commandline() 111
problem function-size /src/tools/tor-resolve.c:build_socks5_resolve_request() 102
problem function-size /src/tools/tor-resolve.c:do_resolve() 171
problem function-size /src/tools/tor-resolve.c:main() 112
problem dependency-violation /scripts/maint/practracker/testdata/a.c 3
problem dependency-violation /scripts/maint/practracker/testdata/header.h 3
problem dependency-violation /src/core/crypto/hs_ntor.h 1
problem dependency-violation /src/core/or/cell_queue_st.h 1
problem dependency-violation /src/core/or/channel.h 1
problem dependency-violation /src/core/or/circuitlist.h 1
problem dependency-violation /src/core/or/connection_edge.h 1
problem dependency-violation /src/core/or/or.h 1
scripts/maint/practracker/practracker.py
View file @
796a9b37
...
...
@@ -218,7 +218,8 @@ def main(argv):
filt
.
addThreshold
(
problem
.
FileSizeItem
(
"*.h"
,
int
(
args
.
max_h_file_size
)))
filt
.
addThreshold
(
problem
.
IncludeCountItem
(
"*.h"
,
int
(
args
.
max_h_include_count
)))
filt
.
addThreshold
(
problem
.
FunctionSizeItem
(
"*.c"
,
int
(
args
.
max_function_size
)))
filt
.
addThreshold
(
problem
.
DependencyViolationItem
(
"*"
,
int
(
args
.
max_dependency_violations
)))
filt
.
addThreshold
(
problem
.
DependencyViolationItem
(
"*.c"
,
int
(
args
.
max_dependency_violations
)))
filt
.
addThreshold
(
problem
.
DependencyViolationItem
(
"*.h"
,
int
(
args
.
max_dependency_violations
)))
# 1) Get all the .c files we care about
files_list
=
util
.
get_tor_c_files
(
TOR_TOPDIR
)
...
...
scripts/maint/practracker/test_practracker.sh
View file @
796a9b37
...
...
@@ -25,7 +25,9 @@ DATA="${PRACTRACKER_DIR}/testdata"
run_practracker
()
{
"
${
PYTHON
:-
python
}
"
"
${
PRACTRACKER_DIR
}
/practracker.py"
\
--max-include-count
=
0
--max-file-size
=
0
--max-function-size
=
0
--terse
\
--max-include-count
=
0
--max-file-size
=
0
\
--max-h-include-count
=
0
--max-h-file-size
=
0
\
--max-function-size
=
0
--terse
\
"
${
DATA
}
/"
"
$@
"
;
}
compare
()
{
...
...
scripts/maint/practracker/testdata/.may_include
0 → 100644
View file @
796a9b37
!advisory
permitted.h
scripts/maint/practracker/testdata/a.c
View file @
796a9b37
...
...
@@ -3,7 +3,7 @@
#include
"two.h"
#incldue "three.h"
# include "
four
.h"
# include "
permitted
.h"
int
i_am_a_function
(
void
)
...
...
scripts/maint/practracker/testdata/ex0-expected.txt
View file @
796a9b37
...
...
@@ -2,6 +2,10 @@ problem file-size a.c 38
problem include-count a.c 4
problem function-size a.c:i_am_a_function() 9
problem function-size a.c:another_function() 12
problem dependency-violation a.c 3
problem file-size b.c 15
problem function-size b.c:foo() 4
problem function-size b.c:bar() 5
problem file-size header.h 8
problem include-count header.h 4
problem dependency-violation header.h 3
scripts/maint/practracker/testdata/ex1.txt
View file @
796a9b37
...
...
@@ -9,3 +9,7 @@ problem file-size b.c 15
# This is removed, and so will produce an error.
# problem function-size b.c:foo() 4
problem function-size b.c:bar() 5
problem dependency-violation a.c 3
problem dependency-violation header.h 3
problem file-size header.h 8
problem include-count header.h 4
scripts/maint/practracker/testdata/header.h
0 → 100644
View file @
796a9b37
// some forbidden includes
#include
"foo.h"
#include
"quux.h"
#include
"quup.h"
// a permitted include
#include
"permitted.h"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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