{"thread":{"id":"66683","subject":"[PATCH 0/8] running unit tests inside a test-lib script","startedAt":"2026-10-27T17:32:05Z","lastAt":"2026-10-27T17:42:31Z","messageCount":9,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"556537","messageId":"20261027173205.GA97799@coredump.intra.peff.net","threadId":"66683","inReplyTo":null,"subject":"[PATCH 0/8] running unit tests inside a test-lib script","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:32:05Z","receivedAt":"2026-10-27T17:32:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"I saw a unit-test failure in CI a while back, and much to my annoyance\nit was quite hard to debug, because we don't report the unit-test output\nat all!\n\nThe problem is that we feed the unit-test binary to prove, which eats the\nTAP output it produces. Normal tests get around this by using\n--verbose-log (and then CI dumps the log). But the unit-test script\nsilently ignores that option, and you get no feedback at all about which\ntest failed.\n\nWe could fix that, obviously, but I think it's a symptom of a larger\nproblem: we don't do the usual setup things that test-lib.sh does.\nAnother example I found in the real world is that we skip some\nenvironment setup, like LSAN_OPTIONS, leading to worse output for some\nleaks. I'd guess there are other cases, as well.\n\nSo the real goal of this series is patch 5, which just lets us wrap the\nunit-test binary in a regular t0001-unit-tests.sh script. Patch 4 is the\ntest-lib.sh tweaks needed for this.\n\nAnd naturally, the whole thing turned up a few bugs, which are fixed in\npatches 1-3. But it also turned up a number of cleanup possibilities.\nThe diffstat is very satisfying, but note the final two which I've\nmarked as RFC.\n\nThis would also avoid the need for the unit-tests to ignore test-lib\noptions, like the patches we saw recently in:\n\n  https://lore.kernel.org/git/20261026-ks-unit-tests-ignore-long-tests-v2-0-fdbbefbd19fb@gmail.com/\n\nI didn't clean up the existing ignored ones here, but I think it would\nprobably be reasonable to do so.\n\n  [1/8]: unit-tests: report the correct unexpected argument\n  [2/8]: test-lib: drop unused test_external_has_tap variable\n  [3/8]: test-lib: stop inventing a JUnit testcase for empty suites\n  [4/8]: test-lib: allow an external program to supply TAP output\n  [5/8]: t: run clar unit tests through test-lib.sh\n  [6/8]: t: drop redundant unit-test invocations\n  [7/8]: test-tool: drop the run-command testsuite mode\n  [8/8]: test-lib: drop the shell JUnit XML reporting code\n\n Makefile                    |   1 -\n ci/run-test-slice.sh        |   5 --\n t/Makefile                  |  12 +--\n t/helper/meson.build        |   1 -\n t/helper/test-run-command.c | 173 ------------------------------------\n t/helper/test-tool.c        |   1 -\n t/helper/test-tool.h        |   1 -\n t/helper/test-xml-encode.c  |  80 -----------------\n t/meson.build               |   4 +-\n t/run-test.sh               |  18 ----\n t/t0011-unit-tests.sh       |  20 +++++\n t/test-lib-junit.sh         | 132 ---------------------------\n t/test-lib.sh               |  16 ++--\n t/unit-tests/unit-test.c    |   2 +-\n 14 files changed, 33 insertions(+), 433 deletions(-)\n delete mode 100644 t/helper/test-xml-encode.c\n delete mode 100755 t/run-test.sh\n create mode 100755 t/t0011-unit-tests.sh\n delete mode 100644 t/test-lib-junit.sh\n\n"},{"id":"556538","messageId":"20261027173235.GA136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 1/8] unit-tests: report the correct unexpected argument","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:32:35Z","receivedAt":"2026-10-27T17:32:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We use PARSE_OPT_KEEP_ARGV0 when parsing the unit-test command line, so\nargv[0] still contains the program name afterwards. If we find an extra\nargument, though, we report argv[0] as the offending parameter. This makes\nan invocation like \"unit-tests foo\" complain about \"unit-tests\" instead\nof \"foo\".\n\nReport argv[1] instead, which is the first argument we didn't consume.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/unit-tests/unit-test.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/unit-tests/unit-test.c b/t/unit-tests/unit-test.c\nindex 752fb38fb3..8eda87856c 100644\n--- a/t/unit-tests/unit-test.c\n+++ b/t/unit-tests/unit-test.c\n@@ -48,7 +48,7 @@ int cmd_main(int argc, const char **argv)\n \targc = parse_options(argc, argv, NULL, options,\n \t\t\t     unit_test_usage, PARSE_OPT_KEEP_ARGV0);\n \tif (argc > 1)\n-\t\tusagef(_(\"extra command line parameter '%s'\"), argv[0]);\n+\t\tusagef(_(\"extra command line parameter '%s'\"), argv[1]);\n \n \tstrvec_push(&args, argv[0]);\n \tstrvec_push(&args, \"-t\");\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556539","messageId":"20261027173245.GB136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 2/8] test-lib: drop unused test_external_has_tap variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:32:45Z","receivedAt":"2026-10-27T17:32:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The test_external_has_tap variable was used by test_external to remember\nwhether an external test produced TAP output. But we dropped\ntest_external in 5beca49a0b (test-lib: simplify by removing\ntest_external, 2022-07-28). Drop this leftover initialization.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/test-lib.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex a893963f86..3d001b91da 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -771,8 +771,6 @@ test_success=0\n \n test_missing_prereq=\n \n-test_external_has_tap=0\n-\n die () {\n \tcode=$?\n \t# This is responsible for running the atexit commands even when a\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556540","messageId":"20261027173525.GC136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 3/8] test-lib: stop inventing a JUnit testcase for empty suites","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:35:25Z","receivedAt":"2026-10-27T17:35:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If a script finishes without reporting any test cases, the JUnit output\ncode tries to call write_junit_xml_testcase(). But that function went\naway in 78d5e4cfb4 (tests: refactor --write-junit-xml code, 2022-05-21),\nso we get a shell error instead. A script which sets skip_all and calls\ntest_done without running any tests is enough to trigger this. For\nexample, on Linux:\n\n  $ ./t0051-windows-named-pipe.sh --write-junit-xml\n  ./t0051-windows-named-pipe.sh: 97: write_junit_xml_testcase: not found\n  1..0 # SKIP skipping Windows-specific tests\n\nThis is mostly an annoyance, but it gets even worse with the \"set -e\"\ndetector:\n\n  $ GIT_TEST_USE_SET_E=1 ./t0051-windows-named-pipe.sh --write-junit-xml\n  ./t0051-windows-named-pipe.sh: 97: write_junit_xml_testcase: not found\n  FATAL: Unexpected exit with code 127\n\nBefore the refactoring in that commit, the fallback wrote a successful\ntestcase named \"all tests skipped\". We could resurrect that, but I'm not\nsure it actually makes sense. We can just leave the suite empty if we\ndon't have any testcases to report.\n\nThis also prepares us for scripts which delegate TAP output to an\nexternal program. We can't report those as JUnit XML (we don't know what\nwas in the TAP!), but it does prevent us from inventing fake results or\ncomplaining about the missing function.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI do propose dropping the JUnit support entirely in the final patch, but\nthis is the minimum needed to unblock the rest of the series in the\nmeantime (in case we do want to keep it).\n\n t/test-lib-junit.sh | 7 -------\n 1 file changed, 7 deletions(-)\n\ndiff --git a/t/test-lib-junit.sh b/t/test-lib-junit.sh\nindex f4994dd9d3..03a7360198 100644\n--- a/t/test-lib-junit.sh\n+++ b/t/test-lib-junit.sh\n@@ -86,17 +86,11 @@ finalize_test_case_output () {\n \t\tdate getnanos $junit_start)\\\"\"\n \twrite_junit_xml \"$(printf '%s\\n' \\\n \t\t\"    <testcase $junit_attrs>\" \"$@\" \"    </testcase>\")\"\n-\tjunit_have_testcase=t\n }\n \n finalize_test_output () {\n \tif test -n \"$junit_xml_path\"\n \tthen\n-\t\ttest -n \"$junit_have_testcase\" || {\n-\t\t\tjunit_start=$(test-tool date getnanos)\n-\t\t\twrite_junit_xml_testcase \"all tests skipped\"\n-\t\t}\n-\n \t\t# adjust the overall time\n \t\tjunit_time=$(test-tool date getnanos $junit_suite_start)\n \t\tsed -e \"s/\\(<testsuite.*\\) time=\\\"[^\\\"]*\\\"/\\1/\" \\\n@@ -114,7 +108,6 @@ write_junit_xml () {\n \tcase \"$1\" in\n \t--truncate)\n \t\t>\"$junit_xml_path\"\n-\t\tjunit_have_testcase=\n \t\tshift\n \t\t;;\n \tesac\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556541","messageId":"20261027173645.GD136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 4/8] test-lib: allow an external program to supply TAP output","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:36:45Z","receivedAt":"2026-10-27T17:36:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"A program which produces its own TAP output can't use test-lib.sh,\nbecause our TAP header and test counts conflict.\n\nWe used to support this with test_external, but dropped it in 5beca49a0b\n(test-lib: simplify by removing test_external, 2022-07-28). That\ninterface let you mix shell tests with external TAP, which required\nspecial handling for the test counts. But we can bring back a much\nsimpler variant: tell test-lib.sh up front that it will be a thin\nwrapper for an external TAP generator, and let it stay out of the way.\n\nNow you might ask what is the point of using test-lib.sh at all if it's\nnot going to generate any output. And the point is: it does other useful\nsetup, like handling logging, setting certain environment variables, and\nso on. The next commit will wrap the clar unit-tests which will bring\nsome real-world benefits.\n\nThe only changes we need here are avoiding the TAP header and the plan\ncount. Note that if we skip the whole script via GIT_SKIP_TESTS, though,\nwe still have to emit a count (since we wouldn't run the external\ncommand at all).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/test-lib.sh | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3d001b91da..3754db0ea7 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1277,8 +1277,11 @@ test_done () {\n \n \t\t# Maybe print SKIP message\n \t\ttest -z \"$skip_all\" || skip_all=\"# SKIP $skip_all\"\n-\t\tcase \"$test_count\" in\n-\t\t0)\n+\t\tcase \"$test_external,$skip_all,$test_count\" in\n+\t\tt,,*)\n+\t\t\t: nothing\n+\t\t\t;;\n+\t\t*,*,0)\n \t\t\tsay \"1..$test_count${skip_all:+ $skip_all}\"\n \t\t\t;;\n \t\t*)\n@@ -1534,7 +1537,7 @@ then\n \tBAIL_OUT 'You need to build test-tool; Run \"make t/helper/test-tool\" in the source (toplevel) directory'\n fi\n \n-if test -n \"$HARNESS_ACTIVE\"\n+if test -n \"$HARNESS_ACTIVE\" && test -z \"$test_external\"\n then\n \tsay \"TAP version 13\"\n \tsay \"pragma +strict\"\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556542","messageId":"20261027173824.GE136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 5/8] t: run clar unit tests through test-lib.sh","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:38:24Z","receivedAt":"2026-10-27T17:38:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We run the clar unit-test binary directly, without going through\ntest-lib.sh. This means it misses out on the setup done by the shell\ntests, and is inconsistent with the rest of the test suite.\n\nI've hit two specific cases in practice. One is that we accept but\nignore --verbose-log. This means that if unit-tests fail in CI (which\nruns the tests under prove, eating their stdout), we never get to see\nthe failing test output at all!\n\nAnother is that test-lib.sh sets sanitizer options like LSAN_OPTIONS.\nYou can see the difference by creating an intentional leak like this:\n\n  diff --git a/t/unit-tests/u-strbuf.c b/t/unit-tests/u-strbuf.c\n  index caa5d78aa3..4d252902ed 100644\n  --- a/t/unit-tests/u-strbuf.c\n  +++ b/t/unit-tests/u-strbuf.c\n  @@ -84,6 +84,8 @@ static void t_addstr(struct strbuf *buf, const void *data)\n   \tsize_t orig_alloc = buf->alloc;\n   \tsize_t orig_len = buf->len;\n\n  +\twrite(2, strdup(\"foo\"), 3);\n  +\n   \tassert_sane_strbuf(buf);\n   \tstrbuf_addstr(buf, text);\n   \tassert_sane_strbuf(buf);\n\nWithout fast_unwind_on_malloc=0, you get a fairly useless report. With\ntest-lib.sh's settings, we get the full stack trace.\n\nObviously we could port these features into the unit-test code. But by\nwrapping them in a regular test script we get that for free, plus it\nwill let us get rid of some extra complexities in our prove invocations\n(in subsequent patches).\n\nWe do have to forward any relevant options to the unit-test binary. We\nshould do that here in t0011 and not as a central test-lib.sh feature,\nbecause the set of handled options may differ between external programs\n(if we ever even get a second one). Right now we support --immediate and\nnothing else. In theory we should be able to handle --run, but the\nsyntax is a bit different between the two systems. This is no worse than\nthe existing behavior, though, since run-test.sh only passes\nGIT_TEST_OPTS to shell tests, not to the unit-test binary.\n\nLikewise we do not support --write-junit-xml; the unit-tests will run\nbut the results won't be present in the XML output. It would be possible\nto support this with some work, but for now we are not making anything\nworse (the unit-tests are currently run separately and do not even\nsupport the option).\n\nOne note on the implementation: we have to inform meson of the\ndependency. Without that, running \"meson test t0011-unit-tests\" would\nfail (but \"meson compile\" first would be OK, because it builds the unit\ntests). The make system doesn't have the same problem, because it just\ndepends on \"all\" before testing (the meson equivalent would be depending\non \"compile\", but it is more fine-grained).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/meson.build         |  3 +++\n t/t0011-unit-tests.sh | 20 ++++++++++++++++++++\n 2 files changed, 23 insertions(+)\n create mode 100755 t/t0011-unit-tests.sh\n\ndiff --git a/t/meson.build b/t/meson.build\nindex 11b3752f00..fc628ad2d1 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -76,6 +76,8 @@ clar_unit_tests = executable('unit-tests',\n )\n test('unit-tests', clar_unit_tests, kwargs: test_kwargs)\n \n+test_dependencies += clar_unit_tests\n+\n subdir('helper')\n \n integration_tests = [\n@@ -90,6 +92,7 @@ integration_tests = [\n   't0008-ignores.sh',\n   't0009-git-dir-validation.sh',\n   't0010-racy-git.sh',\n+  't0011-unit-tests.sh',\n   't0012-help.sh',\n   't0013-sha1dc.sh',\n   't0014-alias.sh',\ndiff --git a/t/t0011-unit-tests.sh b/t/t0011-unit-tests.sh\nnew file mode 100755\nindex 0000000000..ac3d7ccda2\n--- /dev/null\n+++ b/t/t0011-unit-tests.sh\n@@ -0,0 +1,20 @@\n+#!/bin/sh\n+\n+test_description='run clar unit tests'\n+test_external=t\n+. ./test-lib.sh\n+\n+# We store the binary in different locations for make vs meson. Yuck.\n+if test -d \"$GIT_BUILD_DIR/t/unit-tests\"\n+then\n+\tUNIT_TESTS=\"$GIT_BUILD_DIR/t/unit-tests/bin/unit-tests\"\n+else\n+\tUNIT_TESTS=\"$GIT_BUILD_DIR/t/unit-tests\"\n+fi\n+\n+# Pass along any options that are meaningful to the unit-test binary here.\n+\"$UNIT_TESTS\" \\\n+\t${immediate:+-i} \\\n+\t|| error \"unit-test binary failed\"\n+\n+test_done\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556544","messageId":"20261027174022.GF136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[PATCH 6/8] t: drop redundant unit-test invocations","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:40:22Z","receivedAt":"2026-10-27T17:40:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Now that t0011 runs the clar unit tests, running the binary separately\nfrom the shell tests would execute them twice. Drop the separate Meson\ntest and the extra invocation in the first CI test slice, along with the\nunit-tests-test-tool target it used. We can also drop UNIT_TESTS_NO_DIR,\nwhich supplied the arguments for that target.\n\nLikewise, stop passing the unit-test binaries to prove alongside the\nshell tests. Since all of its inputs are now shell scripts, we can use\nTEST_SHELL_PATH directly instead of run-test.sh, and pass GIT_TEST_OPTS\nthrough prove's \"::\" separator. This leaves no users of run-test.sh, so\nwe can drop it, too.\n\nYou can still run the unit-tests directly if you want to. I've also left\n\"make unit-tests\" intact, though I'm not sure if it is actually useful.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n ci/run-test-slice.sh |  5 -----\n t/Makefile           | 12 ++----------\n t/meson.build        |  1 -\n t/run-test.sh        | 18 ------------------\n 4 files changed, 2 insertions(+), 34 deletions(-)\n delete mode 100755 t/run-test.sh\n\ndiff --git a/ci/run-test-slice.sh b/ci/run-test-slice.sh\nindex d0063efc42..fd66443626 100755\n--- a/ci/run-test-slice.sh\n+++ b/ci/run-test-slice.sh\n@@ -10,9 +10,4 @@ TESTS=$(cd t && ./helper/test-tool path-utils slice-tests \"$1\" \"$2\" t[0-9]*.sh)\n group \"Run tests\" make --quiet -C t T=\"$(echo \"$TESTS\" | tr '\\n' ' ')\" ||\n handle_failed_tests\n \n-# We only have one unit test at the moment, so run it in the first slice.\n-if [ \"$1\" == \"1\" ] ; then\n-\tgroup \"Run unit tests\" make --quiet -C t unit-tests-test-tool\n-fi\n-\n check_unignored_build_artifacts\ndiff --git a/t/Makefile b/t/Makefile\nindex e3249879c4..1d2eca9ae4 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -54,7 +54,6 @@ UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)\n UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%$(X),$(UNIT_TEST_SOURCES))\n UNIT_TEST_PROGRAMS += unit-tests/bin/unit-tests$(X)\n UNIT_TESTS = $(sort $(UNIT_TEST_PROGRAMS))\n-UNIT_TESTS_NO_DIR = $(notdir $(UNIT_TESTS))\n \n # `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)\n # checks all tests in all scripts via a single invocation, so tell individual\n@@ -79,7 +78,7 @@ failed:\n \n prove: pre-clean $(TEST_LINT)\n \t@echo \"*** prove (shell & unit tests) ***\"\n-\t@$(CHAINLINTSUPPRESS) TEST_OPTIONS='$(GIT_TEST_OPTS)' TEST_SHELL_PATH='$(TEST_SHELL_PATH_SQ)' $(PROVE) --exec ./run-test.sh $(GIT_PROVE_OPTS) $(T) $(UNIT_TESTS)\n+\t@$(CHAINLINTSUPPRESS) $(PROVE) --exec '$(TEST_SHELL_PATH_SQ)' $(GIT_PROVE_OPTS) $(T) :: $(GIT_TEST_OPTS)\n \t$(MAKE) clean-except-prove-cache\n \n $(T):\n@@ -88,21 +87,14 @@ $(T):\n $(UNIT_TESTS):\n \t@echo \"*** $@ ***\"; $@\n \n-.PHONY: unit-tests unit-tests-raw unit-tests-prove unit-tests-test-tool\n+.PHONY: unit-tests unit-tests-raw unit-tests-prove\n unit-tests: $(DEFAULT_UNIT_TEST_TARGET)\n \n unit-tests-raw: $(UNIT_TESTS)\n \n unit-tests-prove:\n \t@echo \"*** prove - unit tests ***\"; $(PROVE) $(GIT_PROVE_OPTS) $(UNIT_TESTS)\n \n-unit-tests-test-tool:\n-\t@echo \"*** test-tool - unit tests **\"\n-\t( \\\n-\t\tcd unit-tests/bin && \\\n-\t\t../../helper/test-tool$X run-command testsuite $(UNIT_TESTS_NO_DIR)\\\n-\t)\n-\n pre-clean:\n \t$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'\n \ndiff --git a/t/meson.build b/t/meson.build\nindex fc628ad2d1..4dc47824f5 100644\n--- a/t/meson.build\n+++ b/t/meson.build\n@@ -74,7 +74,6 @@ clar_unit_tests = executable('unit-tests',\n   ),\n   dependencies: [libgit_commonmain],\n )\n-test('unit-tests', clar_unit_tests, kwargs: test_kwargs)\n \n test_dependencies += clar_unit_tests\n \ndiff --git a/t/run-test.sh b/t/run-test.sh\ndeleted file mode 100755\nindex 63328ac630..0000000000\n--- a/t/run-test.sh\n+++ /dev/null\n@@ -1,18 +0,0 @@\n-#!/bin/sh\n-\n-# A simple wrapper to run shell tests via TEST_SHELL_PATH,\n-# or exec unit tests directly.\n-\n-case \"$1\" in\n-*.sh)\n-\tif test -z \"${TEST_SHELL_PATH}\"\n-\tthen\n-\t\techo >&2 \"ERROR: TEST_SHELL_PATH is empty or not set\"\n-\t\texit 1\n-\tfi\n-\texec \"${TEST_SHELL_PATH}\" \"$@\" ${TEST_OPTIONS}\n-\t;;\n-*)\n-\texec \"$@\"\n-\t;;\n-esac\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556545","messageId":"20261027174108.GG136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[RFC/PATCH 7/8] test-tool: drop the run-command testsuite mode","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:41:08Z","receivedAt":"2026-10-27T17:41:08Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The last commit removed the final in-tree caller of \"test-tool\nrun-command testsuite\"; it was used only for unit tests, which now\nrun through the normal suite.\n\nOne of the original uses for it was supporting Azure pipelines, but we\ndropped that support in e39e332e50 (ci: remove stale code for Azure\nPipelines, 2025-01-10). So in theory it is not used anywhere anymore.\n\nHowever, commit be5d88e112 (test-tool run-command: learn to run (parts\nof) the testsuite, 2019-10-06) indicates that it may also be useful for\nVisual Studio users to run the tests without make or prove. It's unclear\nif that is still a useful mode or not (if it is, we should drop or\nrevert this patch).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n t/helper/test-run-command.c | 173 ------------------------------------\n 1 file changed, 173 deletions(-)\n\ndiff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c\nindex 4a56456894..137bdc9d54 100644\n--- a/t/helper/test-run-command.c\n+++ b/t/helper/test-run-command.c\n@@ -15,9 +15,6 @@\n #include \"strvec.h\"\n #include \"strbuf.h\"\n #include \"parse-options.h\"\n-#include \"string-list.h\"\n-#include \"thread-utils.h\"\n-#include \"wildmatch.h\"\n \n static int number_callbacks;\n static int parallel_next(struct child_process *cp,\n@@ -103,174 +100,6 @@ static int test_stdin_pipe_feed(int hook_stdin_fd, void *cb UNUSED, void *task_c\n \treturn !(*lines_remaining);\n }\n \n-struct testsuite {\n-\tstruct string_list tests, failed;\n-\tint next;\n-\tint quiet, immediate, verbose, verbose_log, trace, write_junit_xml;\n-\tconst char *shell_path;\n-};\n-#define TESTSUITE_INIT { \\\n-\t.tests = STRING_LIST_INIT_DUP, \\\n-\t.failed = STRING_LIST_INIT_DUP, \\\n-}\n-\n-static int next_test(struct child_process *cp, struct strbuf *err, void *cb,\n-\t\t     void **task_cb)\n-{\n-\tstruct testsuite *suite = cb;\n-\tconst char *test;\n-\tif (suite->next >= suite->tests.nr)\n-\t\treturn 0;\n-\n-\ttest = suite->tests.items[suite->next++].string;\n-\tif (suite->shell_path)\n-\t\tstrvec_push(&cp->args, suite->shell_path);\n-\tstrvec_push(&cp->args, test);\n-\tif (suite->quiet)\n-\t\tstrvec_push(&cp->args, \"--quiet\");\n-\tif (suite->immediate)\n-\t\tstrvec_push(&cp->args, \"-i\");\n-\tif (suite->verbose)\n-\t\tstrvec_push(&cp->args, \"-v\");\n-\tif (suite->verbose_log)\n-\t\tstrvec_push(&cp->args, \"-V\");\n-\tif (suite->trace)\n-\t\tstrvec_push(&cp->args, \"-x\");\n-\tif (suite->write_junit_xml)\n-\t\tstrvec_push(&cp->args, \"--write-junit-xml\");\n-\n-\tstrbuf_addf(err, \"Output of '%s':\\n\", test);\n-\t*task_cb = (void *)test;\n-\n-\treturn 1;\n-}\n-\n-static int test_finished(int result, struct strbuf *err, void *cb,\n-\t\t\t void *task_cb)\n-{\n-\tstruct testsuite *suite = cb;\n-\tconst char *name = (const char *)task_cb;\n-\n-\tif (result)\n-\t\tstring_list_append(&suite->failed, name);\n-\n-\tstrbuf_addf(err, \"%s: '%s'\\n\", result ? \"FAIL\" : \"SUCCESS\", name);\n-\n-\treturn 0;\n-}\n-\n-static int test_failed(struct strbuf *out, void *cb, void *task_cb)\n-{\n-\tstruct testsuite *suite = cb;\n-\tconst char *name = (const char *)task_cb;\n-\n-\tstring_list_append(&suite->failed, name);\n-\tstrbuf_addf(out, \"FAILED TO START: '%s'\\n\", name);\n-\n-\treturn 0;\n-}\n-\n-static const char * const testsuite_usage[] = {\n-\t\"test-run-command testsuite [<options>] [<pattern>...]\",\n-\tNULL\n-};\n-\n-static int testsuite(int argc, const char **argv)\n-{\n-\tstruct testsuite suite = TESTSUITE_INIT;\n-\tint max_jobs = 1, i, ret = 0;\n-\tDIR *dir;\n-\tstruct dirent *d;\n-\tstruct option options[] = {\n-\t\tOPT_BOOL('i', \"immediate\", &suite.immediate,\n-\t\t\t \"stop at first failed test case(s)\"),\n-\t\tOPT_INTEGER('j', \"jobs\", &max_jobs, \"run <N> jobs in parallel\"),\n-\t\tOPT_BOOL('q', \"quiet\", &suite.quiet, \"be terse\"),\n-\t\tOPT_BOOL('v', \"verbose\", &suite.verbose, \"be verbose\"),\n-\t\tOPT_BOOL('V', \"verbose-log\", &suite.verbose_log,\n-\t\t\t \"be verbose, redirected to a file\"),\n-\t\tOPT_BOOL('x', \"trace\", &suite.trace, \"trace shell commands\"),\n-\t\tOPT_BOOL(0, \"write-junit-xml\", &suite.write_junit_xml,\n-\t\t\t \"write JUnit-style XML files\"),\n-\t\tOPT_END()\n-\t};\n-\tstruct run_process_parallel_opts opts = {\n-\t\t.get_next_task = next_test,\n-\t\t.start_failure = test_failed,\n-\t\t.feed_pipe = test_stdin_pipe_feed,\n-\t\t.task_finished = test_finished,\n-\t\t.data = &suite,\n-\t};\n-\tstruct strbuf progpath = STRBUF_INIT;\n-\tsize_t path_prefix_len;\n-\n-\targc = parse_options(argc, argv, NULL, options,\n-\t\t\ttestsuite_usage, PARSE_OPT_STOP_AT_NON_OPTION);\n-\n-\tif (max_jobs <= 0)\n-\t\tmax_jobs = online_cpus();\n-\n-\t/*\n-\t * If we run without a shell, execute the programs directly from CWD.\n-\t */\n-\tsuite.shell_path = getenv(\"TEST_SHELL_PATH\");\n-\tif (!suite.shell_path)\n-\t\tstrbuf_addstr(&progpath, \"./\");\n-\tpath_prefix_len = progpath.len;\n-\n-\tdir = opendir(\".\");\n-\tif (!dir)\n-\t\tdie(\"Could not open the current directory\");\n-\twhile ((d = readdir(dir))) {\n-\t\tconst char *p = d->d_name;\n-\n-\t\tif (!strcmp(p, \".\") || !strcmp(p, \"..\"))\n-\t\t\tcontinue;\n-\n-\t\t/* No pattern: match all */\n-\t\tif (!argc) {\n-\t\t\tstrbuf_setlen(&progpath, path_prefix_len);\n-\t\t\tstrbuf_addstr(&progpath, p);\n-\t\t\tstring_list_append(&suite.tests, progpath.buf);\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tfor (i = 0; i < argc; i++)\n-\t\t\tif (!wildmatch(argv[i], p, 0)) {\n-\t\t\t\tstrbuf_setlen(&progpath, path_prefix_len);\n-\t\t\t\tstrbuf_addstr(&progpath, p);\n-\t\t\t\tstring_list_append(&suite.tests, progpath.buf);\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t}\n-\tclosedir(dir);\n-\n-\tif (!suite.tests.nr)\n-\t\tdie(\"No tests match!\");\n-\tif (max_jobs > suite.tests.nr)\n-\t\tmax_jobs = suite.tests.nr;\n-\n-\tfprintf(stderr, \"Running %\"PRIuMAX\" tests (%d at a time)\\n\",\n-\t\t(uintmax_t)suite.tests.nr, max_jobs);\n-\n-\topts.processes = max_jobs;\n-\trun_processes_parallel(&opts);\n-\n-\tif (suite.failed.nr > 0) {\n-\t\tret = 1;\n-\t\tfprintf(stderr, \"%\"PRIuMAX\" tests failed:\\n\\n\",\n-\t\t\t(uintmax_t)suite.failed.nr);\n-\t\tfor (i = 0; i < suite.failed.nr; i++)\n-\t\t\tfprintf(stderr, \"\\t%s\\n\", suite.failed.items[i].string);\n-\t}\n-\n-\tstring_list_clear(&suite.tests, 0);\n-\tstring_list_clear(&suite.failed, 0);\n-\tstrbuf_release(&progpath);\n-\n-\treturn ret;\n-}\n-\n static uint64_t my_random_next = 1234;\n \n static uint64_t my_random(void)\n@@ -448,8 +277,6 @@ int cmd__run_command(int argc, const char **argv)\n \t\t.data = &proc,\n \t};\n \n-\tif (argc > 1 && !strcmp(argv[1], \"testsuite\"))\n-\t\treturn testsuite(argc - 1, argv + 1);\n \tif (!strcmp(argv[1], \"inherited-handle\"))\n \t\treturn inherit_handle(argv[0]);\n \tif (!strcmp(argv[1], \"inherited-handle-child\"))\n-- \n2.56.0.559.g7c1a1d8168\n\n\n"},{"id":"556546","messageId":"20261027174231.GH136740@coredump.intra.peff.net","threadId":"66683","inReplyTo":"20261027173205.GA97799@coredump.intra.peff.net","subject":"[RFC/PATCH 8/8] test-lib: drop the shell JUnit XML reporting code","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-10-27T17:42:31Z","receivedAt":"2026-10-27T17:42:31Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Our shell tests can produce JUnit XML with --write-junit-xml, but we\ndon't have any in-tree callers. The Azure Pipelines consumer went away,\nwith the remaining CI references removed in e39e332e50 (ci: remove stale\ncode for Azure Pipelines, 2025-01-10).\n\nGitLab CI does still consume JUnit XML, but that's generated by Meson in\nmeson-logs/testlog.junit.xml, not by us directly.\n\nIt's possible that somebody is invoking the tests with --write-junit-xml\nthemselves, but we have no easy way of knowing. If so then we'd need to\ndrop/revert this patch. I tend to doubt it somewhat, though. We fixed a\nbug earlier in the series that would cause several tests to fail when\nrun with \"set -e\", and we enable that feature automatically when the\ntest suite is run under recent versions of bash. So there's a reasonable\nchance anybody using it would have been seeing test failures since\nffe8005b9d (t: detect errors outside of test cases, 2026-04-21).\n\nGetting rid of the option lets us also drop the test-lib-junit.sh file\nand the test-tool xml encoder. Note that the start_test_case_output and\nfinalize_test_output hooks in test-lib.sh aren't used by anybody, but\nI've left them for now. In theory they're generally useful, and they\ndon't cost very much to support. The other hooks are still used for\nGitHub workflow annotations.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Makefile                   |   1 -\n t/helper/meson.build       |   1 -\n t/helper/test-tool.c       |   1 -\n t/helper/test-tool.h       |   1 -\n t/helper/test-xml-encode.c |  80 ------------------------\n t/test-lib-junit.sh        | 125 -------------------------------------\n t/test-lib.sh              |   5 +-\n 7 files changed, 1 insertion(+), 213 deletions(-)\n delete mode 100644 t/helper/test-xml-encode.c\n delete mode 100644 t/test-lib-junit.sh\n\ndiff --git a/Makefile b/Makefile\nindex a96be506b5..20ccdb7fa7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -879,7 +879,6 @@ TEST_BUILTINS_OBJS += test-userdiff.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\n TEST_BUILTINS_OBJS += test-windows-named-pipe.o\n TEST_BUILTINS_OBJS += test-write-cache.o\n-TEST_BUILTINS_OBJS += test-xml-encode.o\n TEST_BUILTINS_OBJS += test-zlib.o\n \n # Do not add more tests here unless they have extra dependencies. Add\ndiff --git a/t/helper/meson.build b/t/helper/meson.build\nindex ae513b4cdc..3dcc4d5219 100644\n--- a/t/helper/meson.build\n+++ b/t/helper/meson.build\n@@ -77,7 +77,6 @@ test_tool_sources = [\n   'test-wildmatch.c',\n   'test-windows-named-pipe.c',\n   'test-write-cache.c',\n-  'test-xml-encode.c',\n   'test-zlib.c',\n ]\n \ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex b71a22b43b..b1be64da06 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -86,7 +86,6 @@ static struct test_cmd cmds[] = {\n \t{ \"trace2\", cmd__trace2 },\n \t{ \"truncate\", cmd__truncate },\n \t{ \"userdiff\", cmd__userdiff },\n-\t{ \"xml-encode\", cmd__xml_encode },\n \t{ \"wildmatch\", cmd__wildmatch },\n #ifdef GIT_WINDOWS_NATIVE\n \t{ \"windows-named-pipe\", cmd__windows_named_pipe },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex f2885b33d5..17b72276a1 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -79,7 +79,6 @@ int cmd__synthesize(int argc, const char **argv);\n int cmd__trace2(int argc, const char **argv);\n int cmd__truncate(int argc, const char **argv);\n int cmd__userdiff(int argc, const char **argv);\n-int cmd__xml_encode(int argc, const char **argv);\n int cmd__wildmatch(int argc, const char **argv);\n #ifdef GIT_WINDOWS_NATIVE\n int cmd__windows_named_pipe(int argc, const char **argv);\ndiff --git a/t/helper/test-xml-encode.c b/t/helper/test-xml-encode.c\ndeleted file mode 100644\nindex b2f330d1a4..0000000000\n--- a/t/helper/test-xml-encode.c\n+++ /dev/null\n@@ -1,80 +0,0 @@\n-#include \"test-tool.h\"\n-\n-static const char *utf8_replace_character = \"&#xfffd;\";\n-\n-/*\n- * Encodes (possibly incorrect) UTF-8 on <stdin> to <stdout>, to be embedded\n- * in an XML file.\n- */\n-int cmd__xml_encode(int argc UNUSED, const char **argv UNUSED)\n-{\n-\tunsigned char buf[1024], tmp[4], *tmp2 = NULL;\n-\tssize_t cur = 0, len = 1, remaining = 0;\n-\tunsigned char ch;\n-\n-\tfor (;;) {\n-\t\tif (++cur == len) {\n-\t\t\tlen = xread(0, buf, sizeof(buf));\n-\t\t\tif (!len)\n-\t\t\t\treturn 0;\n-\t\t\tif (len < 0)\n-\t\t\t\tdie_errno(\"Could not read <stdin>\");\n-\t\t\tcur = 0;\n-\t\t}\n-\t\tch = buf[cur];\n-\n-\t\tif (tmp2) {\n-\t\t\tif ((ch & 0xc0) != 0x80) {\n-\t\t\t\tfputs(utf8_replace_character, stdout);\n-\t\t\t\ttmp2 = NULL;\n-\t\t\t\tcur--;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\t*tmp2 = ch;\n-\t\t\ttmp2++;\n-\t\t\tif (--remaining == 0) {\n-\t\t\t\tfwrite(tmp, tmp2 - tmp, 1, stdout);\n-\t\t\t\ttmp2 = NULL;\n-\t\t\t}\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tif (!(ch & 0x80)) {\n-\t\t\t/* 0xxxxxxx */\n-\t\t\tif (ch == '&')\n-\t\t\t\tfputs(\"&amp;\", stdout);\n-\t\t\telse if (ch == '\\'')\n-\t\t\t\tfputs(\"&apos;\", stdout);\n-\t\t\telse if (ch == '\"')\n-\t\t\t\tfputs(\"&quot;\", stdout);\n-\t\t\telse if (ch == '<')\n-\t\t\t\tfputs(\"&lt;\", stdout);\n-\t\t\telse if (ch == '>')\n-\t\t\t\tfputs(\"&gt;\", stdout);\n-\t\t\telse if (ch >= 0x20)\n-\t\t\t\tfputc(ch, stdout);\n-\t\t\telse if (ch == 0x09 || ch == 0x0a || ch == 0x0d)\n-\t\t\t\tfprintf(stdout, \"&#x%02x;\", ch);\n-\t\t\telse\n-\t\t\t\tfputs(utf8_replace_character, stdout);\n-\t\t} else if ((ch & 0xe0) == 0xc0) {\n-\t\t\t/* 110XXXXx 10xxxxxx */\n-\t\t\ttmp[0] = ch;\n-\t\t\tremaining = 1;\n-\t\t\ttmp2 = tmp + 1;\n-\t\t} else if ((ch & 0xf0) == 0xe0) {\n-\t\t\t/* 1110XXXX 10Xxxxxx 10xxxxxx */\n-\t\t\ttmp[0] = ch;\n-\t\t\tremaining = 2;\n-\t\t\ttmp2 = tmp + 1;\n-\t\t} else if ((ch & 0xf8) == 0xf0) {\n-\t\t\t/* 11110XXX 10XXxxxx 10xxxxxx 10xxxxxx */\n-\t\t\ttmp[0] = ch;\n-\t\t\tremaining = 3;\n-\t\t\ttmp2 = tmp + 1;\n-\t\t} else\n-\t\t\tfputs(utf8_replace_character, stdout);\n-\t}\n-\n-\treturn 0;\n-}\ndiff --git a/t/test-lib-junit.sh b/t/test-lib-junit.sh\ndeleted file mode 100644\nindex 03a7360198..0000000000\n--- a/t/test-lib-junit.sh\n+++ /dev/null\n@@ -1,125 +0,0 @@\n-# Library of functions to format test scripts' output in JUnit XML\n-# format, to support Git's test suite result to be presented in an\n-# easily digestible way on Azure Pipelines.\n-#\n-# Copyright (c) 2022 Johannes Schindelin\n-#\n-# This program is free software: you can redistribute it and/or modify\n-# it under the terms of the GNU General Public License as published by\n-# the Free Software Foundation, either version 2 of the License, or\n-# (at your option) any later version.\n-#\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n-# GNU General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with this program.  If not, see https://www.gnu.org/licenses/ .\n-#\n-# The idea is for `test-lib.sh` to source this file when the user asks\n-# for JUnit XML; these functions will then override (empty) functions\n-# that are called at the appropriate times during the test runs.\n-\n-start_test_output () {\n-\tjunit_xml_dir=\"$TEST_OUTPUT_DIRECTORY/out\"\n-\tmkdir -p \"$junit_xml_dir\"\n-\tjunit_xml_base=${1##*/}\n-\tjunit_xml_path=\"$junit_xml_dir/TEST-${junit_xml_base%.sh}.xml\"\n-\tjunit_attrs=\"name=\\\"${junit_xml_base%.sh}\\\"\"\n-\tjunit_attrs=\"$junit_attrs timestamp=\\\"$(TZ=UTC \\\n-\t\tdate +%Y-%m-%dT%H:%M:%S)\\\"\"\n-\twrite_junit_xml --truncate \"<testsuites>\" \"  <testsuite $junit_attrs>\"\n-\tjunit_suite_start=$(test-tool date getnanos)\n-\tif test -n \"$GIT_TEST_TEE_OUTPUT_FILE\"\n-\tthen\n-\t\tGIT_TEST_TEE_OFFSET=0\n-\tfi\n-}\n-\n-start_test_case_output () {\n-\tjunit_start=$(test-tool date getnanos)\n-}\n-\n-finalize_test_case_output () {\n-\ttest_case_result=$1\n-\tshift\n-\tcase \"$test_case_result\" in\n-\tok)\n-\t\tset -- \"$*\"\n-\t\t;;\n-\tfailure)\n-\t\tjunit_insert=\"<failure message=\\\"not ok $test_count -\"\n-\t\tjunit_insert=\"$junit_insert $(xml_attr_encode --no-lf \"$1\")\\\">\"\n-\t\tjunit_insert=\"$junit_insert $(xml_attr_encode \\\n-\t\t\t\"$(if test -n \"$GIT_TEST_TEE_OUTPUT_FILE\"\n-\t\t\t   then\n-\t\t\t\ttest-tool path-utils skip-n-bytes \\\n-\t\t\t\t\t\"$GIT_TEST_TEE_OUTPUT_FILE\" $GIT_TEST_TEE_OFFSET\n-\t\t\t   else\n-\t\t\t\tprintf '%s\\n' \"$@\" | sed 1d\n-\t\t\t   fi)\")\"\n-\t\tjunit_insert=\"$junit_insert</failure>\"\n-\t\tif test -n \"$GIT_TEST_TEE_OUTPUT_FILE\"\n-\t\tthen\n-\t\t\tjunit_insert=\"$junit_insert<system-err>$(xml_attr_encode \\\n-\t\t\t\t\"$(cat \"$GIT_TEST_TEE_OUTPUT_FILE\")\")</system-err>\"\n-\t\tfi\n-\t\tset -- \"$1\" \"      $junit_insert\"\n-\t\t;;\n-\tfixed)\n-\t\tset -- \"$* (breakage fixed)\"\n-\t\t;;\n-\tbroken)\n-\t\tset -- \"$* (known breakage)\"\n-\t\t;;\n-\tskip)\n-\t\tmessage=\"$(xml_attr_encode --no-lf \"$skipped_reason\")\"\n-\t\tset -- \"$1\" \"      <skipped message=\\\"$message\\\" />\"\n-\t\t;;\n-\tesac\n-\n-\tjunit_attrs=\"name=\\\"$(xml_attr_encode --no-lf \"$this_test.$test_count $1\")\\\"\"\n-\tshift\n-\tjunit_attrs=\"$junit_attrs classname=\\\"$this_test\\\"\"\n-\tjunit_attrs=\"$junit_attrs time=\\\"$(test-tool \\\n-\t\tdate getnanos $junit_start)\\\"\"\n-\twrite_junit_xml \"$(printf '%s\\n' \\\n-\t\t\"    <testcase $junit_attrs>\" \"$@\" \"    </testcase>\")\"\n-}\n-\n-finalize_test_output () {\n-\tif test -n \"$junit_xml_path\"\n-\tthen\n-\t\t# adjust the overall time\n-\t\tjunit_time=$(test-tool date getnanos $junit_suite_start)\n-\t\tsed -e \"s/\\(<testsuite.*\\) time=\\\"[^\\\"]*\\\"/\\1/\" \\\n-\t\t\t-e \"s/<testsuite [^>]*/& time=\\\"$junit_time\\\"/\" \\\n-\t\t\t-e '/^ *<\\/testsuite/d' \\\n-\t\t\t<\"$junit_xml_path\" >\"$junit_xml_path.new\"\n-\t\tmv \"$junit_xml_path.new\" \"$junit_xml_path\"\n-\n-\t\twrite_junit_xml \"  </testsuite>\" \"</testsuites>\"\n-\t\twrite_junit_xml=\n-\tfi\n-}\n-\n-write_junit_xml () {\n-\tcase \"$1\" in\n-\t--truncate)\n-\t\t>\"$junit_xml_path\"\n-\t\tshift\n-\t\t;;\n-\tesac\n-\tprintf '%s\\n' \"$@\" >>\"$junit_xml_path\"\n-}\n-\n-xml_attr_encode () {\n-\tif test \"x$1\" = \"x--no-lf\"\n-\tthen\n-\t\tshift\n-\t\tprintf '%s' \"$*\" | test-tool xml-encode\n-\telse\n-\t\tprintf '%s\\n' \"$@\" | test-tool xml-encode\n-\tfi\n-}\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3754db0ea7..c107fd687a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -195,7 +195,7 @@ mark_option_requires_arg () {\n \tstore_arg_to=$2\n }\n \n-# These functions can be overridden e.g. to output JUnit XML\n+# These functions can be overridden e.g. to add CI workflow annotations\n start_test_output () { :; }\n start_test_case_output () { :; }\n finalize_test_case_output () { :; }\n@@ -260,9 +260,6 @@ parse_option () {\n \t\tverbose_log=t\n \t\ttee=t\n \t\t;;\n-\t--write-junit-xml)\n-\t\t. \"$TEST_DIRECTORY/test-lib-junit.sh\"\n-\t\t;;\n \t--github-workflow-markup)\n \t\t. \"$TEST_DIRECTORY/test-lib-github-workflow-markup.sh\"\n \t\t;;\n-- \n2.56.0.559.g7c1a1d8168\n\n"}]}