From 87cff36f9db60cdbb026ecbac7956a1e1925ee7e Mon Sep 17 00:00:00 2001 From: Joshua Beck Date: Mon, 26 Sep 2011 20:43:39 -0500 Subject: [PATCH] Updated manual and added test for reading file list from stdin. --- man/cppcheck.1.xml | 2 +- test/testcmdlineparser.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/man/cppcheck.1.xml b/man/cppcheck.1.xml index 88536f431..a8e3f2fd4 100644 --- a/man/cppcheck.1.xml +++ b/man/cppcheck.1.xml @@ -225,7 +225,7 @@ Example: -DDEBUG=1 -D__cplusplus - Specify the files to check in a text file. One filename per line. + Specify the files to check in a text file. One filename per line. When file is -, the file list will be read from standard input. diff --git a/test/testcmdlineparser.cpp b/test/testcmdlineparser.cpp index b85e00e2a..af59fb011 100644 --- a/test/testcmdlineparser.cpp +++ b/test/testcmdlineparser.cpp @@ -71,6 +71,7 @@ private: TEST_CASE(exitcodeSuppressions); TEST_CASE(exitcodeSuppressionsNoFile); TEST_CASE(fileList); // TODO: Create and test real file listing file + TEST_CASE(fileListStdin); TEST_CASE(inlineSuppr); TEST_CASE(jobs); TEST_CASE(jobsMissingCount); @@ -530,6 +531,16 @@ private: CmdLineParser parser(&settings); TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(4, argv)); } + + void fileListStdin() + { + // TODO: Give it some stdin to read from + REDIRECT; + const char *argv[] = {"cppcheck", "--file-list", "-", "file.cpp"}; + Settings settings; + CmdLineParser parser(&settings); + TODO_ASSERT_EQUALS(true, false, parser.ParseFromArgs(4, argv)); + } void inlineSuppr() {