test: optionally test contrib in CI

Recently it was reported that a topic merged to 'next' broke build and test for contrib/subtree part of the system. Instead of having those who run 'next' or 'master' to hit the build and test breakage and report to us, make sure we notice breakages in contrib/ area before they hit my tree at all, during their own presubmit testing. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 2, 2026 at 13:07 UTC 3c6162ea5c137fb90d100865162f460af9f53a0a
3 files changed +19
Makefile
+6
@@ -342,6 +342,9 @@ include shared.mak
342 # If it isn't set, fallback to $LC_ALL, $LANG or use the first utf-8
343 # locale returned by "locale -a".
344 #
345 +# Define TEST_CONTRIB_TOO to make "make test" run tests in contrib/
346 +# directories.
347 +#
348 # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime.
349 #
350 # Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC.
@@ -3369,6 +3372,9 @@ export TEST_NO_MALLOC_CHECK
3372
3373 test: all
3374 $(MAKE) -C t/ all
3375 +ifdef TEST_CONTRIB_TOO
3376 + $(MAKE) -C contrib/ test
3377 +endif
3378
3379 perf: all
3380 $(MAKE) -C t/perf/ all
ci/run-build-and-tests.sh
+3
@@ -5,6 +5,8 @@
5
6 . ${0%/*}/lib.sh
7
8 +export TEST_CONTRIB_TOO=yes
9 +
10 case "$jobname" in
11 fedora-breaking-changes-musl|linux-breaking-changes)
12 export WITH_BREAKING_CHANGES=YesPlease
@@ -36,6 +38,7 @@ linux-sha256)
38 linux-reftable|linux-reftable-leaks|osx-reftable)
39 export GIT_TEST_DEFAULT_REF_FORMAT=reftable
40 ;;
41 +
42 esac
43
44 case "$jobname" in
contrib/Makefile new
+10
@@ -0,0 +1,10 @@
1 +all::
2 +
3 +test::
4 + $(MAKE) -C diff-highlight $@
5 + $(MAKE) -C subtree $@
6 +
7 +clean::
8 + $(MAKE) -C contacts $@
9 + $(MAKE) -C diff-highlight $@
10 + $(MAKE) -C subtree $@