"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:
Christian Weisgerber <naddy@mips.inka.de>, gameoftrees@openbsd.org
Date:
Tue, 14 Feb 2023 23:47:08 +1100

Download raw body.

Thread
On 23-02-14 01:24PM, Stefan Sperling wrote:
> On Tue, Feb 14, 2023 at 11:11:26PM +1100, Mark Jamsek wrote:
> > On 23-02-14 12:47PM, Christian Weisgerber wrote:
> > > Mark Jamsek:
> > > 
> > > > I made adjusting regress for the new fetch behaviour change more
> > > > difficult than necessary because of a copypasta error where the reported
> > > > failure returned a bogus test function. Silly error on my part but to
> > > > figure out the cause of the failure I added $LINENO to the output such
> > > 
> > > Portability concern: Although LINENO is in POSIX, it's only covered
> > > as part of an extension.  dash, the somewhat popular minimalist sh
> > > on Linux, does not support it ... or at least older versions of
> > > dash still used by stable versions of Debian don't support LINENO.
> > 
> > Thanks, naddy! I wasn't too sure of its portability impact so was hoping
> > you or someone as knowledgeable would have some insight.
> > 
> > It's really not an important change; it just helped with a problem of my
> > own making and I thought to share it in case it might have some broader
> > utility that appeals to others. But our tests already do provide enough
> > info to isolate any problems so I think it might be best to forget this,
> > at least for now.
> > 
> > Thanks again :)
> 
> I agree that this would be nice to have, but portability is indeed
> a concern for -portable. It would also be nice to have a solution
> that only tweaks test_done in one place rather than having to pass
> additional parameters. But I don't have no idea how that could be done.

I'm not sure either; we can't use $LINENO in test_done() because it'll
just show the line number inside common.sh:test_done(). This could be
done with some macros in C but I've no idea in shell.

> Maybe it is time to rewrite the tests in Rust?

:D rust all the things! /s

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