Add integration tests for new practracker features

These tests check our .may_include checking, and our header file
checking.

They do not pass yet: we have a bug in our filtering code.
This commit is contained in:
Nick Mathewson
2019-08-26 12:28:46 -04:00
parent 859514d477
commit c710518825
6 changed files with 23 additions and 2 deletions
@@ -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() {
+3
View File
@@ -0,0 +1,3 @@
!advisory
permitted.h
+1 -1
View File
@@ -3,7 +3,7 @@
#include "two.h"
#incldue "three.h"
# include "four.h"
# include "permitted.h"
int
i_am_a_function(void)
+4
View File
@@ -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
+4
View File
@@ -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
+8
View File
@@ -0,0 +1,8 @@
// some forbidden includes
#include "foo.h"
#include "quux.h"
#include "quup.h"
// a permitted include
#include "permitted.h"