CTest: Add ability to dynamically generate resource spec file

Issue: #25106
48 files changed