]> Kevux Git Server - rit/commitdiff
test: optionally test contrib in CI
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 Feb 2026 21:07:58 +0000 (13:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Feb 2026 17:26:18 +0000 (09:26 -0800)
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>
Makefile
ci/run-build-and-tests.sh
contrib/Makefile [new file with mode: 0644]

index 8aa489f..d0ab8fd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -342,6 +342,9 @@ include shared.mak
 # If it isn't set, fallback to $LC_ALL, $LANG or use the first utf-8
 # locale returned by "locale -a".
 #
+# Define TEST_CONTRIB_TOO to make "make test" run tests in contrib/
+# directories.
+#
 # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime.
 #
 # Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC.
@@ -3369,6 +3372,9 @@ export TEST_NO_MALLOC_CHECK
 
 test: all
        $(MAKE) -C t/ all
+ifdef TEST_CONTRIB_TOO
+       $(MAKE) -C contrib/ test
+endif
 
 perf: all
        $(MAKE) -C t/perf/ all
index 8bda62b..28cfe73 100755 (executable)
@@ -5,6 +5,8 @@
 
 . ${0%/*}/lib.sh
 
+export TEST_CONTRIB_TOO=yes
+
 case "$jobname" in
 fedora-breaking-changes-musl|linux-breaking-changes)
        export WITH_BREAKING_CHANGES=YesPlease
@@ -36,6 +38,7 @@ linux-sha256)
 linux-reftable|linux-reftable-leaks|osx-reftable)
        export GIT_TEST_DEFAULT_REF_FORMAT=reftable
        ;;
+
 esac
 
 case "$jobname" in
diff --git a/contrib/Makefile b/contrib/Makefile
new file mode 100644 (file)
index 0000000..787cd07
--- /dev/null
@@ -0,0 +1,10 @@
+all::
+
+test::
+       $(MAKE) -C diff-highlight $@
+       $(MAKE) -C subtree $@
+
+clean::
+       $(MAKE) -C contacts $@
+       $(MAKE) -C diff-highlight $@
+       $(MAKE) -C subtree $@