| 525 | } |
| 526 | |
| 527 | void checkPlistOutput() const { |
| 528 | Suppressions supprs; |
| 529 | ErrorLogger2 errorLogger; |
| 530 | std::vector<std::string> files = {"textfile.txt"}; |
| 531 | |
| 532 | { |
| 533 | const auto s = dinit(Settings, $.templateFormat = templateFormat, $.plistOutput = "output"); |
| 534 | const ScopedFile file("file", ""); |
| 535 | CppCheck cppcheck(s, supprs, errorLogger, nullptr, false, {}); |
| 536 | const FileWithDetails fileWithDetails {file.path(), Path::identify(file.path(), false), 0}; |
| 537 | |
| 538 | cppcheck.checkPlistOutput(fileWithDetails, files); |
| 539 | const std::string outputFile {"outputfile_" + std::to_string(std::hash<std::string> {}(fileWithDetails.spath())) + ".plist"}; |
| 540 | ASSERT(Path::exists(outputFile)); |
| 541 | std::remove(outputFile.c_str()); |
| 542 | } |
| 543 | |
| 544 | { |
| 545 | const auto s = dinit(Settings, $.plistOutput = "output"); |
| 546 | const ScopedFile file("file.c", ""); |
| 547 | CppCheck cppcheck(s, supprs, errorLogger, nullptr, false, {}); |
| 548 | const FileWithDetails fileWithDetails {file.path(), Path::identify(file.path(), false), 0}; |
| 549 | |
| 550 | cppcheck.checkPlistOutput(fileWithDetails, files); |
| 551 | const std::string outputFile {"outputfile_" + std::to_string(std::hash<std::string> {}(fileWithDetails.spath())) + ".plist"}; |
| 552 | ASSERT(Path::exists(outputFile)); |
| 553 | std::remove(outputFile.c_str()); |
| 554 | } |
| 555 | |
| 556 | { |
| 557 | Settings s; |
| 558 | const ScopedFile file("file.c", ""); |
| 559 | CppCheck cppcheck(s, supprs, errorLogger, nullptr, false, {}); |
| 560 | cppcheck.checkPlistOutput(FileWithDetails(file.path(), Path::identify(file.path(), false), 0), files); |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | void premiumResultsCache() const { |
| 565 | // Trac #13889 - cached misra results are shown after removing --premium=misra-c-2012 option |
nothing calls this directly
no test coverage detected