From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 6/8] t: drop redundant unit-test invocations
Date: Tue, 27 Oct 2026 13:40:22 -0400 [thread overview]
Message-ID: <20261027174022.GF136740@coredump.intra.peff.net> (raw)
In-Reply-To: <20261027173205.GA97799@coredump.intra.peff.net>
Now that t0011 runs the clar unit tests, running the binary separately
from the shell tests would execute them twice. Drop the separate Meson
test and the extra invocation in the first CI test slice, along with the
unit-tests-test-tool target it used. We can also drop UNIT_TESTS_NO_DIR,
which supplied the arguments for that target.
Likewise, stop passing the unit-test binaries to prove alongside the
shell tests. Since all of its inputs are now shell scripts, we can use
TEST_SHELL_PATH directly instead of run-test.sh, and pass GIT_TEST_OPTS
through prove's "::" separator. This leaves no users of run-test.sh, so
we can drop it, too.
You can still run the unit-tests directly if you want to. I've also left
"make unit-tests" intact, though I'm not sure if it is actually useful.
Signed-off-by: Jeff King <peff@peff.net>
---
ci/run-test-slice.sh | 5 -----
t/Makefile | 12 ++----------
t/meson.build | 1 -
t/run-test.sh | 18 ------------------
4 files changed, 2 insertions(+), 34 deletions(-)
delete mode 100755 t/run-test.sh
diff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh
index d0063efc42..fd66443626 100755
--- a/ci/run-test-slice.sh
+++ b/ci/run-test-slice.sh
@@ -10,9 +10,4 @@ TESTS=$(cd t && ./helper/test-tool path-utils slice-tests "$1" "$2" t[0-9]*.sh)
group "Run tests" make --quiet -C t T="$(echo "$TESTS" | tr '\n' ' ')" ||
handle_failed_tests
-# We only have one unit test at the moment, so run it in the first slice.
-if [ "$1" == "1" ] ; then
- group "Run unit tests" make --quiet -C t unit-tests-test-tool
-fi
-
check_unignored_build_artifacts
diff --git a/t/Makefile b/t/Makefile
index e3249879c4..1d2eca9ae4 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -54,7 +54,6 @@ UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))
UNIT_TEST_PROGRAMS += unit-tests/bin/unit-tests$(X)
UNIT_TESTS = $(sort $(UNIT_TEST_PROGRAMS))
-UNIT_TESTS_NO_DIR = $(notdir $(UNIT_TESTS))
# `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
# checks all tests in all scripts via a single invocation, so tell individual
@@ -79,7 +78,7 @@ failed:
prove: pre-clean $(TEST_LINT)
@echo "*** prove (shell & unit tests) ***"
- @$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS)
+ @$(CHAINLINTSUPPRESS) $(PROVE) --exec '$(TEST_SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)
$(MAKE) clean-except-prove-cache
$(T):
@@ -88,21 +87,14 @@ $(T):
$(UNIT_TESTS):
@echo "*** $@ ***"; $@
-.PHONY: unit-tests unit-tests-raw unit-tests-prove unit-tests-test-tool
+.PHONY: unit-tests unit-tests-raw unit-tests-prove
unit-tests: $(DEFAULT_UNIT_TEST_TARGET)
unit-tests-raw: $(UNIT_TESTS)
unit-tests-prove:
@echo "*** prove - unit tests ***"; $(PROVE) $(GIT_PROVE_OPTS) $(UNIT_TESTS)
-unit-tests-test-tool:
- @echo "*** test-tool - unit tests **"
- ( \
- cd unit-tests/bin && \
- ../../helper/test-tool$X run-command testsuite $(UNIT_TESTS_NO_DIR)\
- )
-
pre-clean:
$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
diff --git a/t/meson.build b/t/meson.build
index fc628ad2d1..4dc47824f5 100644
--- a/t/meson.build
+++ b/t/meson.build
@@ -74,7 +74,6 @@ clar_unit_tests = executable('unit-tests',
),
dependencies: [libgit_commonmain],
)
-test('unit-tests', clar_unit_tests, kwargs: test_kwargs)
test_dependencies += clar_unit_tests
diff --git a/t/run-test.sh b/t/run-test.sh
deleted file mode 100755
index 63328ac630..0000000000
--- a/t/run-test.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-# A simple wrapper to run shell tests via TEST_SHELL_PATH,
-# or exec unit tests directly.
-
-case "$1" in
-*.sh)
- if test -z "${TEST_SHELL_PATH}"
- then
- echo >&2 "ERROR: TEST_SHELL_PATH is empty or not set"
- exit 1
- fi
- exec "${TEST_SHELL_PATH}" "$@" ${TEST_OPTIONS}
- ;;
-*)
- exec "$@"
- ;;
-esac
--
2.56.0.559.g7c1a1d8168
next prev parent reply other threads:[~2026-10-27 17:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 17:32 [PATCH 0/8] running unit tests inside a test-lib script Jeff King
2026-10-27 17:32 ` [PATCH 1/8] unit-tests: report the correct unexpected argument Jeff King
2026-10-27 17:32 ` [PATCH 2/8] test-lib: drop unused test_external_has_tap variable Jeff King
2026-10-27 17:35 ` [PATCH 3/8] test-lib: stop inventing a JUnit testcase for empty suites Jeff King
2026-10-27 17:36 ` [PATCH 4/8] test-lib: allow an external program to supply TAP output Jeff King
2026-10-27 17:38 ` [PATCH 5/8] t: run clar unit tests through test-lib.sh Jeff King
2026-10-27 17:40 ` Jeff King [this message]
2026-10-27 17:41 ` [RFC/PATCH 7/8] test-tool: drop the run-command testsuite mode Jeff King
2026-10-27 17:42 ` [RFC/PATCH 8/8] test-lib: drop the shell JUnit XML reporting code Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027174022.GF136740@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox