Updated manual and added test for reading file list from stdin.

This commit is contained in:
Joshua Beck 2011-09-26 20:43:39 -05:00
parent 240ba0118a
commit 87cff36f9d
2 changed files with 12 additions and 1 deletions

View File

@ -225,7 +225,7 @@ Example: -DDEBUG=1 -D__cplusplus</para>
<varlistentry>
<term><option>--file-list=&lt;file&gt;</option></term>
<listitem>
<para>Specify the files to check in a text file. One filename per line.</para>
<para>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.</para>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -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()
{