summaryrefslogtreecommitdiff
path: root/scripts/git
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-16 21:44:44 +1000
committerNick Mathewson <nickm@torproject.org>2019-12-04 12:15:22 -0500
commit5ce45ac90750ebe9a5d482eef0d9e4a6eb4fbb38 (patch)
tree60fff2f6aa98207336c38635312ac27a6462471a /scripts/git
parentc7baacf4c0855728077e553a4685577b1344ac82 (diff)
downloadtor-5ce45ac90750ebe9a5d482eef0d9e4a6eb4fbb38.tar.gz
tor-5ce45ac90750ebe9a5d482eef0d9e4a6eb4fbb38.zip
Makefile/git scripts: Add the practracker unit tests
Add a check-practracker-unit-test target, and run it as part of "make check". Add the practracker unit tests to scripts/git/pre-commit.git-hook. Part of 32609.
Diffstat (limited to 'scripts/git')
-rwxr-xr-xscripts/git/pre-commit.git-hook13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/git/pre-commit.git-hook b/scripts/git/pre-commit.git-hook
index c138d2ae21..c5adfaffe7 100755
--- a/scripts/git/pre-commit.git-hook
+++ b/scripts/git/pre-commit.git-hook
@@ -54,6 +54,13 @@ 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 [ ! "$CHECK_FILES" ]; then
echo "No modified tor-owned source files, skipping further checks"
exit 0
@@ -75,13 +82,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