MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / loadSimpleWithIgnore

Method loadSimpleWithIgnore

gui/test/projectfile/testprojectfile.cpp:81–101  ·  view source on GitHub ↗

Test that project file with old 'ignore' element works

Source from the content-addressed store, hash-verified

79
80// Test that project file with old 'ignore' element works
81void TestProjectFile::loadSimpleWithIgnore() const
82{
83 const QString filepath(QString(SRCDIR) + "/../data/projectfiles/simple_ignore.cppcheck");
84 ProjectFile pfile(filepath);
85 QVERIFY(pfile.read());
86 QCOMPARE(pfile.getRootPath(), QString("../.."));
87 QStringList includes = pfile.getIncludeDirs();
88 QCOMPARE(includes.size(), 2);
89 QCOMPARE(includes[0], QString("lib/"));
90 QCOMPARE(includes[1], QString("cli/"));
91 QStringList paths = pfile.getCheckPaths();
92 QCOMPARE(paths.size(), 2);
93 QCOMPARE(paths[0], QString("gui/"));
94 QCOMPARE(paths[1], QString("test/"));
95 QStringList excludes = pfile.getExcludedPaths();
96 QCOMPARE(excludes.size(), 1);
97 QCOMPARE(excludes[0], QString("gui/temp/"));
98 QStringList defines = pfile.getDefines();
99 QCOMPARE(defines.size(), 1);
100 QCOMPARE(defines[0], QString("FOO"));
101}
102
103void TestProjectFile::loadSimpleNoroot() const
104{

Callers

nothing calls this directly

Calls 8

getRootPathMethod · 0.80
getIncludeDirsMethod · 0.80
getDefinesMethod · 0.80
QStringClass · 0.50
readMethod · 0.45
sizeMethod · 0.45
getCheckPathsMethod · 0.45
getExcludedPathsMethod · 0.45

Tested by

no test coverage detected