Map tilde to underscore in test driver func name
requested to merge spllr/cmake:feature/support-path-containing-tilde-using-create-test-sourcelist into master
Address an issue where create_test_sourcelist
can produce test driver source
code which can not be compiled.
The issue occurs when a project is located under a path containing a tilde (~) resulting in a generated function name containing a tilde.
This fix replaces tilde characters in the function name with an underscore.
Related to #23855 (comment 1231561)