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

Method loadSimple

gui/test/projectfile/testprojectfile.cpp:58–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void TestProjectFile::loadSimple() const
59{
60 const QString filepath(QString(SRCDIR) + "/../data/projectfiles/simple.cppcheck");
61 ProjectFile pfile(filepath);
62 QVERIFY(pfile.read());
63 QCOMPARE(pfile.getRootPath(), QString("../.."));
64 QStringList includes = pfile.getIncludeDirs();
65 QCOMPARE(includes.size(), 2);
66 QCOMPARE(includes[0], QString("lib/"));
67 QCOMPARE(includes[1], QString("cli/"));
68 QStringList paths = pfile.getCheckPaths();
69 QCOMPARE(paths.size(), 2);
70 QCOMPARE(paths[0], QString("gui/"));
71 QCOMPARE(paths[1], QString("test/"));
72 QStringList excludes = pfile.getExcludedPaths();
73 QCOMPARE(excludes.size(), 1);
74 QCOMPARE(excludes[0], QString("gui/temp/"));
75 QStringList defines = pfile.getDefines();
76 QCOMPARE(defines.size(), 1);
77 QCOMPARE(defines[0], QString("FOO"));
78}
79
80// Test that project file with old 'ignore' element works
81void TestProjectFile::loadSimpleWithIgnore() const

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