meson icon indicating copy to clipboard operation
meson copied to clipboard

add skip kw to test function

Open bruchar1 opened this issue 2 years ago • 4 comments

bruchar1 avatar Oct 11 '23 18:10 bruchar1

I don't understand the purpose of this feature.

What does "to keep the test in the list of available tests" mean? It's not actually available. Why is it being skipped? Does it not work? Shouldn't it be marked as EXPECTEDFAIL after running and failing? This also means that you know when it starts working (UNEXPECTEDPASS is an error). Is the test missing some requirements? We have a way for the test itself to communicate this at runtime rather than hardcoding it in the test definition.

If none of this is suitable, and you just want to keep the test in meson.build, why not comment it out?

eli-schwartz avatar Oct 11 '23 19:10 eli-schwartz

In my monorepo, I have a suite of python tests needing pytest for running them. If pytest is not found, I cannot run the tests, but I don't want to prevent other parts of the project being configured. I could just put the test into a conditional block, but then trying to run it would result in an error that the test does not exist. With a conditional skip: not pytest.found(), the test still exists, but will not try to run if pytest is not there, and will be reported as skipped, so I know some tests did not run at all.

bruchar1 avatar Oct 11 '23 19:10 bruchar1

I was referred to this PR from here. I just want to support this feature, it addresses a need that we have identified.

It would be nice if a reason for the skip could also be given (like in my prototype patch), by an additional string argument somewhere. But that might be out of scope for this patch, looking at how the code is structured.

petere avatar Nov 02 '23 15:11 petere

rebased and targeted for 1.4.0

bruchar1 avatar Nov 20 '23 13:11 bruchar1