| 208 | } |
| 209 | |
| 210 | void TestProjectLoad::removeDirRecursive() |
| 211 | { |
| 212 | const TestProject p = makeProject(); |
| 213 | |
| 214 | createFile(p.dir->path()+"/sdf"); |
| 215 | { |
| 216 | QDir d(p.dir->path()); |
| 217 | QVERIFY(d.mkdir(QStringLiteral("blub"))); |
| 218 | QVERIFY(d.cd(QStringLiteral("blub"))); |
| 219 | for (int i=0; i<10; ++i) { |
| 220 | createFile(d.filePath("file"+QString::number(i))); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | QVERIFY(ICore::self()->projectController()->projects().isEmpty()); |
| 225 | |
| 226 | ICore::self()->projectController()->openProject(p.file); |
| 227 | QTRY_COMPARE(ICore::self()->projectController()->projects().size(), 1); |
| 228 | IProject* project = ICore::self()->projectController()->projects().first(); |
| 229 | QCOMPARE(project->projectFile().toUrl(), p.file); |
| 230 | |
| 231 | for (int i=0; i<1; ++i) { |
| 232 | QUrl url = QUrl::fromLocalFile(p.dir->path()+"/blub").adjusted(QUrl::NormalizePathSegments); |
| 233 | QCOMPARE(project->foldersForPath(IndexedString(url)).count(), 1); |
| 234 | |
| 235 | ProjectFolderItem* file = project->foldersForPath(IndexedString(url)).at(0); |
| 236 | project->projectFileManager()->removeFilesAndFolders(QList<ProjectBaseItem*>() << file ); |
| 237 | } |
| 238 | |
| 239 | QTRY_COMPARE(project->projectItem()->fileList().count(), 1); |
| 240 | } |
| 241 | |
| 242 | void TestProjectLoad::addLotsOfFiles() |
| 243 | { |
nothing calls this directly
no test coverage detected