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

Method cppOutput

kdevplatform/language/codegen/tests/test_templateclassgenerator.cpp:268–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void TestTemplateClassGenerator::cppOutput()
269{
270 auto generator = loadTemplate(QStringLiteral("test_cpp"));
271 RETURN_IF_TEST_FAILED();
272 setLowercaseFileNames(generator);
273
274 DocumentChangeSet changes = generator->generate();
275 changes.setFormatPolicy(DocumentChangeSet::NoAutoFormat);
276 changes.applyAllChanges();
277
278 QFile header(baseUrl.resolved(QUrl(QStringLiteral("classname.h"))).toLocalFile());
279 QVERIFY(header.open(QIODevice::ReadOnly));
280
281 QFile testHeader(QStringLiteral(CODEGEN_TESTS_EXPECTED_DIR "/classname.h"));
282 testHeader.open(QIODevice::ReadOnly);
283 COMPARE_FILES(header, testHeader);
284
285 QFile implementation(baseUrl.resolved(QUrl(QStringLiteral("classname.cpp"))).toLocalFile());
286 QVERIFY(implementation.open(QIODevice::ReadOnly));
287
288 QFile testImplementation(QStringLiteral(CODEGEN_TESTS_EXPECTED_DIR "/classname.cpp"));
289 testImplementation.open(QIODevice::ReadOnly);
290 COMPARE_FILES(implementation, testImplementation);
291}
292
293void TestTemplateClassGenerator::yamlOutput()
294{

Callers

nothing calls this directly

Calls 8

setLowercaseFileNamesFunction · 0.85
setFormatPolicyMethod · 0.80
applyAllChangesMethod · 0.80
toLocalFileMethod · 0.80
resolvedMethod · 0.80
QUrlClass · 0.50
generateMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected