On Mon, 2025-09-01 at 14:50 +0200, Tomas Glozar wrote:
> pá 29. 8. 2025 v 23:35 odesílatel Crystal Wood <[email protected]> napsal:
> > 
> > I'm not seeing the "tests/hwnoise.t ... 2/6" part.  What is printing
> > that?
> > 
> 
> Test::Harness (which is one implementation of what is called a "TAP
> harness") is printing that 
> 

It would be nice to not depend on an out-of-tree test harness (does
anything else in the kernel use this?), especially without a prominent
comment mentioning it.

I've just been doing "sudo sh tests/whatever.t".

> (the "prove" command which runs the tests),
> it runs the tests, consumes the output and formats it.

Ugh, "prove" looks like it's some sort of formal rv thing... misleading
name for just running a test suite.

> 
> > > Furthermore, it's standard to first print "not ok" and then the
> > > comments, see the documentation to Test::More [1], so I think we
> > > should keep that.
> > > 
> > > [1] https://metacpan.org/pod/Test::More#ok
> > 
> > https://xkcd.com/927/ :-P
> > 
> > I'm not a Perler, so I didn't recognize it as anything standardized.
> > Still seems backwards to me, both in terms of making it easier to see
> > which test failed, and in terms of being a pain to implement.  And we
> > don't even get the benefit of seeing the test name printed before it
> > runs, to make it easier to see what's taking a long time.
> > 
> 
> We can certainly modify the test system so that it works better for
> us. The TAP standard that is used by the harness to process the output
> of the RTLA test engine [1] does not specify where the additional
> output should go, it's just a convention. I just say this might be
> confusing to people who are used to the "not ok, then error" format,
> which is associated with this type of test.

I'm not suggesting that we break the convention; I just didn't realize
it was a widespread format.

> 
> I'll have a look whether there is a way to easily print the test names
> besides the number.
> 
> [1] https://testanything.org/tap-specification.html

It already does print the test name.  If it didn't I probably would have
made more substantial changes to the test harness :-)

> 
> > Seems like Linux uses a variant of this, though:
> > Documentation/dev-tools/ktap.rst
> > 
> 
> Yes, this is used by kselftests [2], which are written in C.
> 
> [2] https://docs.kernel.org/dev-tools/kselftest.html

Would it make sense for us to use that?

Though the current docs linking to a wiki that's labelled "obsolete
content" isn't encouraging...

> But bpftrace is licensed under Apache 2, so it cannot be in the GPLv2
> kernel source easily.

Sigh...

-Crystal


Reply via email to