CTEST_CUSTOM_POST_TEST runs when doing "ctest -N"

I use CTEST_CUSTOM_POST_TEST in CTestCustom.cmake to do postprocessing of tests.

My problem is that these commands are even executed when I do ctest -N to list available tests.

Is this intended? Is there a ways to prevent this?

I don’t see a way to prevent it. It doesn’t seem intended, but I also see zero tests for this behavior either…

Cc: @brad.king @zackgalbreath

I’d welcome a fix to not run post-test processing when we don’t actually run the tests.

This was also reported as CMake Issue 23254.

Thanks for the fast answer!
I no chose a different way and execute my post-processing in a test script wrapper.