Tests: Add case covering non-writable CMAKE_BINARY_DIR

Issue: #24407
4 files changed