diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-12-04 12:15:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-12-04 12:15:28 -0500 |
commit | fcb565612801ebcbbc27d47b19644039dfdebed2 (patch) | |
tree | 4e48fe7c0237f81adb0cb6755be88eb63bf86754 /scripts/maint/practracker | |
parent | 2693bf47e8f98d38386d79e48d56ecbaaf781a02 (diff) | |
parent | 9ad569c71d081992ac644695064ffb39ce88c61a (diff) | |
download | tor-fcb565612801ebcbbc27d47b19644039dfdebed2.tar.gz tor-fcb565612801ebcbbc27d47b19644039dfdebed2.zip |
Merge branch 'ticket32609_squashed'
Diffstat (limited to 'scripts/maint/practracker')
-rwxr-xr-x | scripts/maint/practracker/includes.py | 4 | ||||
-rw-r--r-- | scripts/maint/practracker/testdata/.may_include | 1 | ||||
-rw-r--r-- | scripts/maint/practracker/testdata/a.c | 3 | ||||
-rw-r--r-- | scripts/maint/practracker/testdata/ex0-expected.txt | 6 | ||||
-rw-r--r-- | scripts/maint/practracker/testdata/ex1-overbroad-expected.txt | 2 | ||||
-rw-r--r-- | scripts/maint/practracker/testdata/ex1.txt | 6 |
6 files changed, 15 insertions, 7 deletions
diff --git a/scripts/maint/practracker/includes.py b/scripts/maint/practracker/includes.py index f2d91b63a1..ed0e11ef28 100755 --- a/scripts/maint/practracker/includes.py +++ b/scripts/maint/practracker/includes.py @@ -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. """ diff --git a/scripts/maint/practracker/testdata/.may_include b/scripts/maint/practracker/testdata/.may_include index 40bf8155d9..8542a35807 100644 --- a/scripts/maint/practracker/testdata/.may_include +++ b/scripts/maint/practracker/testdata/.may_include @@ -1,3 +1,4 @@ !advisory permitted.h +ext/good.c diff --git a/scripts/maint/practracker/testdata/a.c b/scripts/maint/practracker/testdata/a.c index 1939773f57..3c338ab40d 100644 --- a/scripts/maint/practracker/testdata/a.c +++ b/scripts/maint/practracker/testdata/a.c @@ -5,6 +5,9 @@ # include "permitted.h" +#include "ext/good.c" +#include "bad.c" + int i_am_a_function(void) { diff --git a/scripts/maint/practracker/testdata/ex0-expected.txt b/scripts/maint/practracker/testdata/ex0-expected.txt index 5f3d9e5aec..502005edb1 100644 --- a/scripts/maint/practracker/testdata/ex0-expected.txt +++ b/scripts/maint/practracker/testdata/ex0-expected.txt @@ -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 diff --git a/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt index f69c608f40..b757202dae 100644 --- a/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt +++ b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt @@ -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 diff --git a/scripts/maint/practracker/testdata/ex1.txt b/scripts/maint/practracker/testdata/ex1.txt index c698005d07..af8de03291 100644 --- a/scripts/maint/practracker/testdata/ex1.txt +++ b/scripts/maint/practracker/testdata/ex1.txt @@ -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 |