Skip to content

Commit

Permalink
removed deprecated --showtime= value top5
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Jan 22, 2024
1 parent d0d56cd commit bc4c4dd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,10 +1098,6 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_FILE_TOTAL;
else if (showtimeMode == "summary")
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_SUMMARY;
else if (showtimeMode == "top5") {
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
mLogger.printMessage("--showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.");
}
else if (showtimeMode == "top5_file")
mSettings.showtime = SHOWTIME_MODES::SHOWTIME_TOP5_FILE;
else if (showtimeMode == "top5_summary")
Expand Down
1 change: 1 addition & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Other:
- Using Visual Studio with CMake now checks if the CMake version is at least 3.13. This was always required but was not checked explicitly.
- Added '--template=simple'. It is expands to '{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]' without any additional location details.
- Removed deprecated platform type 'Unspecified'. Please use 'unspecified' instead.
- Removed deprecated '--showtime=' value 'top5'. Please use 'top5_file' or 'top5_summary' instead.
5 changes: 2 additions & 3 deletions test/testcmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1743,9 +1743,8 @@ class TestCmdlineParser : public TestFixture {
REDIRECT;
const char * const argv[] = {"cppcheck", "--showtime=top5", "file.cpp"};
settings->showtime = SHOWTIME_MODES::SHOWTIME_NONE;
ASSERT_EQUALS(CmdLineParser::Result::Success, parser->parseFromArgs(3, argv));
ASSERT(settings->showtime == SHOWTIME_MODES::SHOWTIME_TOP5_FILE);
ASSERT_EQUALS("cppcheck: --showtime=top5 is deprecated and will be removed in Cppcheck 2.14. Please use --showtime=top5_file or --showtime=top5_summary instead.\n", logger->str());
ASSERT_EQUALS(CmdLineParser::Result::Fail, parser->parseFromArgs(3, argv));
ASSERT_EQUALS("cppcheck: error: unrecognized --showtime mode: 'top5'. Supported modes: file, file-total, summary, top5, top5_file, top5_summary.\n", logger->str());
}

void showtimeTop5File() {
Expand Down

0 comments on commit bc4c4dd

Please sign in to comment.