aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-18 08:53:17 -0400
committerNick Mathewson <nickm@torproject.org>2019-09-18 10:28:33 -0400
commit1c67d261d528767bc3a24f738dc316635f000f7e (patch)
tree55cccdad69ab67aab4a568d5406dd399c5d18c70
parentd1ffac3f8abbdd5b7d8e5955615821bff3ee3729 (diff)
downloadtor-1c67d261d528767bc3a24f738dc316635f000f7e.tar.gz
tor-1c67d261d528767bc3a24f738dc316635f000f7e.zip
practracker: Integration test for --list-overbroad
Make sure that we list overbroad exceptions, and nothing else
-rw-r--r--Makefile.am1
-rwxr-xr-xscripts/maint/practracker/test_practracker.sh6
-rw-r--r--scripts/maint/practracker/testdata/ex1-overbroad-expected.txt2
-rw-r--r--scripts/maint/practracker/testdata/ex1.txt5
4 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 491b4c8f9f..845440b56f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -183,6 +183,7 @@ EXTRA_DIST+= \
scripts/maint/practracker/testdata/ex0.txt \
scripts/maint/practracker/testdata/ex1-expected.txt \
scripts/maint/practracker/testdata/ex1.txt \
+ scripts/maint/practracker/testdata/ex1-overbroad-expected.txt \
scripts/maint/practracker/testdata/ex.txt \
scripts/maint/practracker/testdata/header.h \
scripts/maint/practracker/testdata/not_c_file \
diff --git a/scripts/maint/practracker/test_practracker.sh b/scripts/maint/practracker/test_practracker.sh
index bfbd0c6560..9b107e071d 100755
--- a/scripts/maint/practracker/test_practracker.sh
+++ b/scripts/maint/practracker/test_practracker.sh
@@ -61,3 +61,9 @@ echo "ex1:"
run_practracker --exceptions "${DATA}/ex1.txt" > "${TMPDIR}/ex1-received.txt"
compare "${TMPDIR}/ex1-received.txt" "${DATA}/ex1-expected.txt"
+
+echo "ex1.overbroad:"
+
+run_practracker --exceptions "${DATA}/ex1.txt" --list-overbroad > "${TMPDIR}/ex1-overbroad-received.txt"
+
+compare "${TMPDIR}/ex1-overbroad-received.txt" "${DATA}/ex1-overbroad-expected.txt"
diff --git a/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt
new file mode 100644
index 0000000000..f69c608f40
--- /dev/null
+++ b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt
@@ -0,0 +1,2 @@
+problem file-size a.c 40 -> 38
+problem file-size z.c 100 -> 0
diff --git a/scripts/maint/practracker/testdata/ex1.txt b/scripts/maint/practracker/testdata/ex1.txt
index f619e33b22..c698005d07 100644
--- a/scripts/maint/practracker/testdata/ex1.txt
+++ b/scripts/maint/practracker/testdata/ex1.txt
@@ -1,5 +1,5 @@
-problem file-size a.c 38
+problem file-size a.c 40
problem include-count a.c 4
# this problem will produce an error
problem function-size a.c:i_am_a_function() 8
@@ -8,6 +8,9 @@ problem function-size a.c:another_function() 11
problem file-size b.c 15
# This is removed, and so will produce an error.
# problem function-size b.c:foo() 4
+# This exception isn't used.
+problem file-size z.c 100
+
problem function-size b.c:bar() 5
problem dependency-violation a.c 3
problem dependency-violation header.h 3