ctest: Show error on invalid ctest arguments

Fixes: #24227
10 files changed