From: Stefan Sperling Subject: Re: [rfc] regress: add line number to failure output To: Mark Jamsek Cc: Omar Polo , Christian Weisgerber , gameoftrees@openbsd.org Date: Thu, 16 Feb 2023 10:15:51 +0100 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 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 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.