| 32 | { |
| 33 | |
| 34 | bool 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 | |
| 59 | std::size_t countMaxConsecutiveEqualSigns(std::string const& name) |
| 60 | { |
no test coverage detected
searching dependent graphs…