| 51 | }; |
| 52 | |
| 53 | TestProject makeProject() |
| 54 | { |
| 55 | TestProject ret; |
| 56 | ret.dir = new QTemporaryDir(); |
| 57 | QFileInfo dir(ret.dir->path()); |
| 58 | Q_ASSERT(dir.exists()); |
| 59 | ret.name = dir.fileName(); |
| 60 | |
| 61 | QStringList projectFileContents; |
| 62 | projectFileContents |
| 63 | << QStringLiteral("[Project]") |
| 64 | << QStringLiteral("Name=") + ret.name |
| 65 | << QStringLiteral("Manager=KDevGenericManager"); |
| 66 | |
| 67 | QUrl projecturl = QUrl::fromLocalFile( dir.absoluteFilePath() + "/simpleproject.kdev4" ); |
| 68 | QFile projectFile(projecturl.toLocalFile()); |
| 69 | projectFile.open(QIODevice::WriteOnly); |
| 70 | projectFile.write(projectFileContents.join(QLatin1Char('\n')).toLatin1()); |
| 71 | projectFile.close(); |
| 72 | ret.file = projecturl; |
| 73 | |
| 74 | Q_ASSERT(ret.dir->isValid()); |
| 75 | Q_ASSERT(projecturl.adjusted(QUrl::RemoveFilename).toLocalFile() == ret.dir->path() + '/'); |
| 76 | |
| 77 | return ret; |
| 78 | } |
| 79 | |
| 80 | bool createFile(const QString& path) |
| 81 | { |
no test coverage detected