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

Method benchGlobbingNoPattern

plugins/qmakemanager/tests/test_qmakefile.cpp:639–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639void TestQMakeFile::benchGlobbingNoPattern()
640{
641 QTemporaryDir tempDir;
642 QDir dir(tempDir.path());
643 const int folders = 10;
644 const int files = 100;
645 for (int i = 0; i < folders; ++i) {
646 QString folder = QStringLiteral("folder%1").arg(i);
647 dir.mkdir(folder);
648 for (int j = 0; j < files; ++j) {
649 QFile f1(dir.filePath(folder + QStringLiteral("/file%1.cpp").arg(j)));
650 QVERIFY(f1.open(QIODevice::WriteOnly));
651 QFile f2(dir.filePath(folder + QStringLiteral("/file%1.h").arg(j)));
652 QVERIFY(f2.open(QIODevice::WriteOnly));
653 }
654 }
655
656 QTemporaryFile testFile(tempDir.path() + "/XXXXXX.pro");
657 QVERIFY(testFile.open());
658 testFile.write("SOURCES = folder0/file1.cpp\n");
659 testFile.close();
660
661 QMakeProjectFile pro(testFile.fileName());
662
663 const auto qmvars = setDefaultMKSpec(pro);
664 if (qmvars.isEmpty()) {
665 QSKIP("Problem querying QMake, skipping test function");
666 }
667
668 QVERIFY(pro.read());
669
670 int found = 0;
671 QBENCHMARK { found = pro.files().size(); }
672
673 QCOMPARE(found, 1);
674}

Callers

nothing calls this directly

Calls 12

setDefaultMKSpecFunction · 0.85
mkdirMethod · 0.80
pathMethod · 0.45
filePathMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45
fileNameMethod · 0.45
isEmptyMethod · 0.45
readMethod · 0.45
sizeMethod · 0.45
filesMethod · 0.45

Tested by

no test coverage detected