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

Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jul 12, 2008, 22:22 UTC
Message-ID
<20080712222212.GC22323@leksak.fem-net>
In-Reply-To
<alpine.DEB.1.00.0807071540310.18205@racer>
Hi,

I'm just cleaning up my inbox and I've seen I've not yet replied to your mail.

Johannes Schindelin wrote:
Show 13 quoted lines
> Hi,
> 
> On Mon, 7 Jul 2008, Stephan Beyer wrote:
> 
> > > > This option realizes a stupid hack that tries to run the test cases 
> > > > line by line (separated by &&).
> > > 
> > > In what way is that better than "sh -x t????-*.sh"?
> > 
> > Your suggestion is more like "./t????-*.sh -v" instead of -s, at least
> > on bash and dash here.
> 
> No, I meant without "-v".
Me, too.

I've written something different: "sh -x" is a great thing and does exactly what it should on simple scripts containing:

	foo &&
	bar &&
	baz

But for a test case in the git test suite it does not work, unfortunately. (Tested on bash, dash and zsh.)

The information I get from
	sh -x ./t????-*.sh
is like the information I get from invoking
	./t????-*.sh -v
but less eye-pleasing.
And ./t????-*.sh -s (using this patch) shows me something like:
	Testing:
		foo
	Testing:
		bar
	* FAIL: blabla
So that I what *command* of the test case fails.
But perhaps I am just doing something wrong.
Show 5 quoted lines
> > But I didn't know the -x flag and it seems that this could be used in 
> > test-lib.sh to make the hack faster, more robust and less hacky ;-)
> 
> It would obsolete your hack, I suggest.  Obviously, you haven't tried it 
> yet.
The obvious is wrong.

I would be very happy to obsolete my slow and error-prone hack, but currently I have not seen a good alternative.

Regards,
  Stephan
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 9 in “[HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.”
  1. Stephan BeyerJul 6, 2008
  2. Johannes SchindelinJul 6, 2008
  3. Stephan BeyerJul 7, 2008
  4. Johannes SchindelinJul 7, 2008
  5. Stephan BeyerJul 12, 2008
  6. Johannes SchindelinJul 13, 2008
  7. Stephan BeyerJul 13, 2008
  8. Johannes SchindelinJul 13, 2008
  9. Stephan BeyerJul 21, 2008

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.