[cmake-developers] Allowed chars in test names

Brad King brad.king at kitware.com
Wed Jul 24 09:38:05 EDT 2013


On 07/22/2013 04:18 PM, Rolf Eike Beer wrote:
> Since d0170584c54b515b7eb2d044c3d48332523b3a37 there is a comment stating that 
> "spaces, quotes, or other characters special in CMake syntax" are not allowed 
> in a test name. This raised 2 topics:

This was just documenting an existing limitation.

> -first: the only check done in add_test() is that the name is not empty. If 
> there are forbidden characters we must test for them, reject everything that 
> is invalid, and have a check that verifies that this works.

One could add such a check and test with a policy for compatibility
if the validation is particularly strict.

> -second: what does "special" mean?

Look at the CMake language lexer.

> I fear that any test name would end up as 
> some sort of target name in Makefile/project files somewhere

They end up in add_test calls in CTestTestfile.cmake files.
We might be able to lift some of the limits by re-escaping test
names as generated into these files.

-Brad



More information about the cmake-developers mailing list