From 959a73f02e0cd25408e6d86b58afad369f0a2c4c Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Wed, 4 May 2011 21:07:02 +0300 Subject: [PATCH] Add test for --check-config. --- test/testcmdlineparser.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index b1bb5ecd5..3e8bc6ce5 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -99,6 +99,7 @@ private: TEST_CASE(ignorepaths4) TEST_CASE(ignorefilepaths1) TEST_CASE(ignorefilepaths2) + TEST_CASE(checkconfig) TEST_CASE(unknownParam); } @@ -801,6 +802,16 @@ private: ASSERT_EQUALS("src/foo.cpp", parser.GetIgnoredPaths()[0]); } + void checkconfig() + { + REDIRECT; + const char *argv[] = {"cppcheck", "--check-config", "file.cpp"}; + Settings settings; + CmdLineParser parser(&settings); + ASSERT(parser.ParseFromArgs(3, argv)); + ASSERT_EQUALS(true, settings.checkConfiguration); + } + void unknownParam() { REDIRECT;