summaryrefslogtreecommitdiff
path: root/scripts/maint
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/maint')
-rwxr-xr-xscripts/maint/practracker/test_practracker.sh11
-rw-r--r--scripts/maint/practracker/testdata/ex0-expected.txt1
-rw-r--r--scripts/maint/practracker/testdata/ex1-expected.txt1
-rw-r--r--scripts/maint/practracker/testdata/ex1-overbroad-expected.txt1
4 files changed, 11 insertions, 3 deletions
diff --git a/scripts/maint/practracker/test_practracker.sh b/scripts/maint/practracker/test_practracker.sh
index 9b107e071d..3c87bc31be 100755
--- a/scripts/maint/practracker/test_practracker.sh
+++ b/scripts/maint/practracker/test_practracker.sh
@@ -15,6 +15,11 @@ if test "${PRACTRACKER_DIR}" = "" ||
PRACTRACKER_DIR=$(dirname "$0")
fi
+# Change to the tor directory, and canonicalise PRACTRACKER_DIR,
+# so paths in practracker output are consistent, even in out-of-tree builds
+cd "${PRACTRACKER_DIR}"/../../..
+PRACTRACKER_DIR="scripts/maint/practracker"
+
TMPDIR="$(mktemp -d -t pracktracker.test.XXXXXX)"
if test -z "${TMPDIR}" || test ! -d "${TMPDIR}" ; then
echo >&2 "mktemp failed."
@@ -52,18 +57,18 @@ echo "unit tests:"
echo "ex0:"
-run_practracker --exceptions "${DATA}/ex0.txt" > "${TMPDIR}/ex0-received.txt"
+run_practracker --exceptions "${DATA}/ex0.txt" > "${TMPDIR}/ex0-received.txt" 2>&1
compare "${TMPDIR}/ex0-received.txt" "${DATA}/ex0-expected.txt"
echo "ex1:"
-run_practracker --exceptions "${DATA}/ex1.txt" > "${TMPDIR}/ex1-received.txt"
+run_practracker --exceptions "${DATA}/ex1.txt" > "${TMPDIR}/ex1-received.txt" 2>&1
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"
+run_practracker --exceptions "${DATA}/ex1.txt" --list-overbroad > "${TMPDIR}/ex1-overbroad-received.txt" 2>&1
compare "${TMPDIR}/ex1-overbroad-received.txt" "${DATA}/ex1-overbroad-expected.txt"
diff --git a/scripts/maint/practracker/testdata/ex0-expected.txt b/scripts/maint/practracker/testdata/ex0-expected.txt
index 502005edb1..dc41c8700a 100644
--- a/scripts/maint/practracker/testdata/ex0-expected.txt
+++ b/scripts/maint/practracker/testdata/ex0-expected.txt
@@ -1,3 +1,4 @@
+Unusual pattern permitted.h in scripts/maint/practracker/testdata
problem file-size a.c 41
problem include-count a.c 6
problem function-size a.c:i_am_a_function() 9
diff --git a/scripts/maint/practracker/testdata/ex1-expected.txt b/scripts/maint/practracker/testdata/ex1-expected.txt
index 58140a4d9a..7800a2cd0e 100644
--- a/scripts/maint/practracker/testdata/ex1-expected.txt
+++ b/scripts/maint/practracker/testdata/ex1-expected.txt
@@ -1,3 +1,4 @@
+Unusual pattern permitted.h in scripts/maint/practracker/testdata
problem function-size a.c:i_am_a_function() 9
(warning) problem function-size a.c:another_function() 12
problem function-size b.c:foo() 4
diff --git a/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt
index b757202dae..ed3cbb29fe 100644
--- a/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt
+++ b/scripts/maint/practracker/testdata/ex1-overbroad-expected.txt
@@ -1,2 +1,3 @@
+Unusual pattern permitted.h in scripts/maint/practracker/testdata
problem file-size a.c 45 -> 41
problem file-size z.c 100 -> 0