MCPcopy Create free account
hub / github.com/Kitware/CMake / needToQuoteTestName

Function needToQuoteTestName

Source/cmTestGenerator.cxx:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32{
33
34bool needToQuoteTestName(cmMakefile const& mf, std::string const& name)
35{
36 // Determine if policy CMP0110 is set to NEW.
37 switch (mf.GetPolicyStatus(cmPolicies::CMP0110)) {
38 case cmPolicies::WARN:
39 // Only warn if a forbidden character is used in the name.
40 if (name.find_first_of("$[] #;\t\n\"\\") != std::string::npos) {
41 mf.IssueMessage(
42 MessageType::AUTHOR_WARNING,
43 cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0110),
44 "\nThe following name given to add_test() is invalid if "
45 "CMP0110 is not set or set to OLD:\n `",
46 name, "´\n"));
47 }
48 CM_FALLTHROUGH;
49 case cmPolicies::OLD:
50 // OLD behavior is to not quote the test's name.
51 return false;
52 case cmPolicies::NEW:
53 default:
54 // NEW behavior is to quote the test's name.
55 return true;
56 }
57}
58
59std::size_t countMaxConsecutiveEqualSigns(std::string const& name)
60{

Callers 3

GenerateOldStyleMethod · 0.85

Calls 4

find_first_ofMethod · 0.80
cmStrCatFunction · 0.70
GetPolicyStatusMethod · 0.45
IssueMessageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…