| 637 | } |
| 638 | |
| 639 | void 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 | } |
nothing calls this directly
no test coverage detected