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 (the "prove" command which runs the tests), it runs the tests, consumes the output and formats it. > > 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'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 > 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 > I'll fix it, hopefully by sticking the error output into a variable or > something rather than duplicating logic. Or should we be using some > existing test infrastructure? > I wanted to use existing infrastructure, but could not find anything suitable. I originally wanted to adopt the runtime test engine from bpftrace, which is also an end-to-end test suite for a userspace program closely related to the kernel. But bpftrace is licensed under Apache 2, so it cannot be in the GPLv2 kernel source easily. I'm not against suggestions, the test suite can always be migrated, that's not the hard part. Tomas
