mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 22:53:44 +01:00
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.
This commit is contained in:
parent
c7baacf4c0
commit
5ce45ac907
@ -253,7 +253,10 @@ test: all
|
|||||||
shellcheck:
|
shellcheck:
|
||||||
$(top_srcdir)/scripts/maint/checkShellScripts.sh
|
$(top_srcdir)/scripts/maint/checkShellScripts.sh
|
||||||
|
|
||||||
check-local: check-spaces check-changes check-includes check-best-practices shellcheck check-cocci
|
check-practracker-unit-test:
|
||||||
|
$(top_srcdir)/scripts/maint/practracker/test_practracker.sh
|
||||||
|
|
||||||
|
check-local: check-spaces check-changes check-includes check-practracker-unit-test check-best-practices shellcheck check-cocci
|
||||||
|
|
||||||
need-chutney-path:
|
need-chutney-path:
|
||||||
@if test ! -d "$$CHUTNEY_PATH"; then \
|
@if test ! -d "$$CHUTNEY_PATH"; then \
|
||||||
|
3
changes/ticket32609
Normal file
3
changes/ticket32609
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
o Testing:
|
||||||
|
- Run the practracker unit tests as part of "make check", and in the
|
||||||
|
pre-commit git hook. Closes ticket 32609.
|
@ -54,6 +54,13 @@ if [ -e scripts/maint/checkShellScripts.sh ]; then
|
|||||||
scripts/maint/checkShellScripts.sh
|
scripts/maint/checkShellScripts.sh
|
||||||
fi
|
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
|
if [ ! "$CHECK_FILES" ]; then
|
||||||
echo "No modified tor-owned source files, skipping further checks"
|
echo "No modified tor-owned source files, skipping further checks"
|
||||||
exit 0
|
exit 0
|
||||||
@ -75,13 +82,9 @@ fi
|
|||||||
# Only call practracker if ${PT_DIR}/.enable_practracker_in_hooks exists
|
# 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
|
# We do this check so that we can enable practracker in hooks in master, and
|
||||||
# disable it on maint branches
|
# disable it on maint branches
|
||||||
PT_DIR=scripts/maint/practracker
|
|
||||||
|
|
||||||
if [ -e "${PT_DIR}/practracker.py" ]; then
|
if [ -e "${PT_DIR}/practracker.py" ]; then
|
||||||
if [ -e "${PT_DIR}/.enable_practracker_in_hooks" ]; then
|
if [ -e "${PT_DIR}/.enable_practracker_in_hooks" ]; then
|
||||||
if ! python3 "${PT_DIR}/practracker.py" "$workdir"; then
|
python3 "${PT_DIR}/practracker.py" "$workdir"
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user