ctest does not show tests when executing in script mode

Hi,

When using ctest like this:

ctest -S <script> -N

Always shows 0 tests selected. Any suggestion are appreciated. Please let me know if i am doing something wrong.
Ctest version being used in 3.28.0

Thanks
Best regards
Phani

I suspect that this is a hole in the handling of command line arguments and ctest_test arguments. If I had to guess, -N intercepts the list that ctest_test ends up consulting. The better option is probably to implement ctest_test(PRINT_ONLY) and to wire up -N to act as if that is specified to all ctest_test calls.

Thanks for the reply. I would suggest ctest_test(SHOW_ONLY) to keep consistent with cmd line option name --show-only.

1 Like

Should I open an issue for this?

That seems reasonable to me.

Created at https://gitlab.kitware.com/cmake/cmake/-/issues/25658