git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] WIP: Report intra-test progress with TAP subtests

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 11, 2010, 01:04 UTC
Message-ID
<20100811010412.GA2994@burratino>
In-Reply-To
<AANLkTi=ygXFpRLR_Z7iEXX3THh+GT7P7X9o+NnaLajqs@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
> On Wed, Aug 11, 2010 at 00:44, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 7 quoted lines
>> Maybe the test harness could automate that a little, by using
>> set -x at the beginning and set +x at the end of each test.
>
> The main use case for this for me is the smoke tester output, where
> you won't get access to the original machine (without asking). Having
> a few intra-test checkpoints helps you to see where things might have
> gone wrong.

I meant something like this: -- 8< --

diff --git a/t/test-lib.sh b/t/test-lib.sh
index e5523dd..a4bc358 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -368,9 +368,11 @@ test_debug () {
 
 test_run_ () {
 	test_cleanup=:
+	set -x
 	eval >&3 2>&4 "$1"
 	eval_ret=$?
 	eval >&3 2>&4 "$test_cleanup"
+	set +x
 	if test "$verbose" = "t" && test -n "$HARNESS_ACTIVE"; then
 		echo ""
 	fi
-- >8 --

but made optional and with output munged into parsable format by
changing PS4 (or "set -T" with a DEBUG trap, if that’s portable
enough).
Previous: Ævar Arnfjörð BjarmasonNext: Johannes Sixt
Message 4 of 7 in “WIP: Report intra-test progress with TAP subtests”
  1. WIP: Report intra-test progress with TAP subtestsÆvar Arnfjörð Bjarmason, Aug 10, 2010
  2. Jonathan NiederAug 11, 2010
  3. Ævar Arnfjörð BjarmasonAug 11, 2010
  4. Jonathan NiederAug 11, 2010
  5. Johannes SixtAug 11, 2010
  6. Jonathan NiederAug 11, 2010
  7. Ævar Arnfjörð BjarmasonAug 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.