MCPcopy Create free account
hub / github.com/KDE/kdevelop / cppTemplate

Method cppTemplate

plugins/filetemplates/tests/test_generationtest.cpp:91–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void TestGenerationTest::cppTemplate()
92{
93 QString description = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("testgenerationtest/template_descriptions/test_qtestlib.desktop"));
94 QVERIFY(!description.isEmpty());
95 SourceFileTemplate file;
96 file.addAdditionalSearchLocation(QStringLiteral(TESTS_DATA_DIR "/testgenerationtest/templates"));
97 file.setTemplateDescription(description);
98
99 QCOMPARE(file.name(), QStringLiteral("Testing C++ Template"));
100 QVERIFY(file.isValid());
101
102 DocumentChangeSet changes = renderer->renderFileTemplate(file, baseUrl, urls(file));
103 changes.applyAllChanges();
104
105 COMPARE_FILES("testname.h");
106 COMPARE_FILES("testname.cpp");
107}
108
109QHash< QString, QUrl > TestGenerationTest::urls (const SourceFileTemplate& file)
110{

Callers

nothing calls this directly

Calls 8

urlsFunction · 0.85
renderFileTemplateMethod · 0.80
applyAllChangesMethod · 0.80
isEmptyMethod · 0.45
nameMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected