"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: [rfc] regress: add line number to failure output
To:
Omar Polo <op@omarpolo.com>, Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Thu, 16 Feb 2023 21:36:59 +1100

Download raw body.

Thread
On 23-02-16 10:15AM, Stefan Sperling wrote:
> On Thu, Feb 16, 2023 at 07:57:11PM +1100, Mark Jamsek wrote:
> > I had a little look to try accomplish this without passing $LINENO to
> > test_done() everywhere but came up empty :(
> > 
> > But, then I thought, for those older systems that don't have LINENO,
> > could we just keep our current output, and only print op's suggested
> > $filename.sh:$LINENO if it is supported?
> > 
> > That way, only meaningful information will be reported where it can,
> > with no change otherwise.
> > 
> > It probably feels like more of a boon than it is because both op and
> > I have lately had relevant situations where it is indeed useful, but
> > I'd also hazard a guess that they won't be the last :)
> > 
> > OTOH, it's a lot of $LINENO!
> 
> I am wondering why I never saw a need for this myself.

I think +95% of the time, it's not needed. And many of the test routines
aren't super long, so the test name is enough to isolate the problem.

In fact, I should probably split up that last fetch test into a few
smaller ones; atomic tests would certainly minimise line number utility.

> I do sometimes add 'set -x' into test functions in stragic places to see
> a trace of the commands being run along with the test failure. Once I
> have managed to fix a test I remove its 'set -x' lines again.
> Does that solve the same problem?

I think it might depend on the problem, and its output is a lot more
verbose, so they both have trade-offs.

> I also often comment out tests in the long list at the bottom of
> the file in order to run a single test case. I wish there was a
> better solution but so far as it has not bothered me too much.

I do that often too.

tbh, it would be nice, but the churn is too much to pay. If I can find
a simpler way, I'll revisit the change. But for now, I can't justify
a 20 KLOC diff for something that has only been a genuine help perhaps
twice for me and once for op out of probably thousands of regress tests.

-- 
Mark Jamsek <fnc.bsdbox.org|got.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68