meson icon indicating copy to clipboard operation
meson copied to clipboard

meson test TEST returns 0 if TEST does not exist

Open mpoquet opened this issue 6 years ago • 4 comments

Hello,

I just discovered that running meson test TEST returns 0 even if TEST does not exist. A clear No suitable tests defined. message is outputted to the user.

Would it not make more sense to return non-zero in this case? The current behavior can be misleading, as users will most probably expect that the test has been executed successfully, not that it has not been executed at all — notably in CI scripts.

Tested version

  • meson-0.49.2
  • ninja-1.8.2

mpoquet avatar Feb 12 '19 18:02 mpoquet

  • ctest also returns 0 for no tests found
  • pytest returns 5 for no tests found

I also prefer to return non-zero for no tests found...

scivision avatar Feb 13 '19 16:02 scivision

This seems like a reasonable change. It should be simple to implement, a few lines of code to mtest.py. Pull requests welcome.

jpakkane avatar Feb 13 '19 19:02 jpakkane

Anyone have a PR for this yet? If not, I'll do it.

andy5995 avatar Nov 30 '22 07:11 andy5995

There was a PR #4927, but that never landed. I don't know of any other PRs

dcbaker avatar Nov 30 '22 18:11 dcbaker

This was fixed by #11647.

bruchar1 avatar May 08 '24 14:05 bruchar1