mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
Merge branch 'ticket32609_squashed'
This commit is contained in:
commit
fcb5656128
@ -260,7 +260,10 @@ test: all
|
||||
shellcheck:
|
||||
$(top_srcdir)/scripts/maint/checkShellScripts.sh
|
||||
|
||||
check-local: check-spaces check-changes check-includes check-best-practices shellcheck check-cocci
|
||||
check-practracker-unit-test:
|
||||
$(top_srcdir)/scripts/maint/practracker/test_practracker.sh
|
||||
|
||||
check-local: check-spaces check-changes check-includes check-practracker-unit-test check-best-practices shellcheck check-cocci
|
||||
|
||||
need-chutney-path:
|
||||
@if test ! -d "$$CHUTNEY_PATH"; then \
|
||||
|
3
changes/ticket32609
Normal file
3
changes/ticket32609
Normal file
@ -0,0 +1,3 @@
|
||||
o Testing:
|
||||
- Run the practracker unit tests as part of "make check", and in the
|
||||
pre-commit git hook. Closes ticket 32609.
|
@ -54,6 +54,17 @@ if [ -e scripts/maint/checkShellScripts.sh ]; then
|
||||
scripts/maint/checkShellScripts.sh
|
||||
fi
|
||||
|
||||
# Always run the practracker unit tests
|
||||
PT_DIR=scripts/maint/practracker
|
||||
|
||||
if [ -e "${PT_DIR}/test_practracker.sh" ]; then
|
||||
"${PT_DIR}/test_practracker.sh"
|
||||
fi
|
||||
|
||||
if [ -e scripts/maint/checkSpaceTest.sh ]; then
|
||||
scripts/maint/checkSpaceTest.sh
|
||||
fi
|
||||
|
||||
if [ ! "$CHECK_FILES" ]; then
|
||||
echo "No modified tor-owned source files, skipping further checks"
|
||||
exit 0
|
||||
@ -75,13 +86,9 @@ fi
|
||||
# Only call practracker if ${PT_DIR}/.enable_practracker_in_hooks exists
|
||||
# We do this check so that we can enable practracker in hooks in master, and
|
||||
# disable it on maint branches
|
||||
PT_DIR=scripts/maint/practracker
|
||||
|
||||
if [ -e "${PT_DIR}/practracker.py" ]; then
|
||||
if [ -e "${PT_DIR}/.enable_practracker_in_hooks" ]; then
|
||||
if ! python3 "${PT_DIR}/practracker.py" "$workdir"; then
|
||||
exit 1
|
||||
fi
|
||||
python3 "${PT_DIR}/practracker.py" "$workdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -13,6 +13,10 @@
|
||||
file in each directory. This file contains empty lines, #-prefixed
|
||||
comments, filenames (like "lib/foo/bar.h") and file globs (like lib/*/*.h)
|
||||
for files that are permitted.
|
||||
|
||||
The script exits with an error if any non-permitted includes are found.
|
||||
.may_include files that contain "!advisory" are considered advisory.
|
||||
Advisory .may_include files only result in warnings, rather than errors.
|
||||
"""
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
!advisory
|
||||
|
||||
permitted.h
|
||||
ext/good.c
|
||||
|
3
scripts/maint/practracker/testdata/a.c
vendored
3
scripts/maint/practracker/testdata/a.c
vendored
@ -5,6 +5,9 @@
|
||||
|
||||
# include "permitted.h"
|
||||
|
||||
#include "ext/good.c"
|
||||
#include "bad.c"
|
||||
|
||||
int
|
||||
i_am_a_function(void)
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
problem file-size a.c 38
|
||||
problem include-count a.c 4
|
||||
problem file-size a.c 41
|
||||
problem include-count a.c 6
|
||||
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 dependency-violation a.c 4
|
||||
problem file-size b.c 15
|
||||
problem function-size b.c:foo() 4
|
||||
problem function-size b.c:bar() 5
|
||||
|
@ -1,2 +1,2 @@
|
||||
problem file-size a.c 40 -> 38
|
||||
problem file-size a.c 45 -> 41
|
||||
problem file-size z.c 100 -> 0
|
||||
|
6
scripts/maint/practracker/testdata/ex1.txt
vendored
6
scripts/maint/practracker/testdata/ex1.txt
vendored
@ -1,6 +1,6 @@
|
||||
|
||||
problem file-size a.c 40
|
||||
problem include-count a.c 4
|
||||
problem file-size a.c 45
|
||||
problem include-count a.c 6
|
||||
# this problem will produce an error
|
||||
problem function-size a.c:i_am_a_function() 8
|
||||
# this problem will produce a warning
|
||||
@ -12,7 +12,7 @@ problem file-size b.c 15
|
||||
problem file-size z.c 100
|
||||
|
||||
problem function-size b.c:bar() 5
|
||||
problem dependency-violation a.c 3
|
||||
problem dependency-violation a.c 4
|
||||
problem dependency-violation header.h 3
|
||||
problem file-size header.h 8
|
||||
problem include-count header.h 4
|
||||
|
2
src/app/config/.may_include
Normal file
2
src/app/config/.may_include
Normal file
@ -0,0 +1,2 @@
|
||||
*.h
|
||||
*.inc
|
1
src/app/main/.may_include
Normal file
1
src/app/main/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/api/.may_include
Normal file
1
src/feature/api/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/client/.may_include
Normal file
1
src/feature/client/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/control/.may_include
Normal file
1
src/feature/control/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/dirauth/.may_include
Normal file
1
src/feature/dirauth/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/dircache/.may_include
Normal file
1
src/feature/dircache/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/dirclient/.may_include
Normal file
1
src/feature/dirclient/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/dircommon/.may_include
Normal file
1
src/feature/dircommon/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/dirparse/.may_include
Normal file
1
src/feature/dirparse/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/hibernate/.may_include
Normal file
1
src/feature/hibernate/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/hs/.may_include
Normal file
1
src/feature/hs/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/hs_common/.may_include
Normal file
1
src/feature/hs_common/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/keymgt/.may_include
Normal file
1
src/feature/keymgt/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/nodelist/.may_include
Normal file
1
src/feature/nodelist/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/relay/.may_include
Normal file
1
src/feature/relay/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/rend/.may_include
Normal file
1
src/feature/rend/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/feature/stats/.may_include
Normal file
1
src/feature/stats/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
2
src/test/.may_include
Normal file
2
src/test/.may_include
Normal file
@ -0,0 +1,2 @@
|
||||
*.h
|
||||
*.inc
|
1
src/test/fuzz/.may_include
Normal file
1
src/test/fuzz/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/tools/.may_include
Normal file
1
src/tools/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/trunnel/.may_include
Normal file
1
src/trunnel/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
1
src/trunnel/hs/.may_include
Normal file
1
src/trunnel/hs/.may_include
Normal file
@ -0,0 +1 @@
|
||||
*.h
|
Loading…
Reference in New Issue
Block a user