| 16 | } |
| 17 | |
| 18 | QSet<QString> TestUtils::getTree(const QString &path, int limit, int depch) { |
| 19 | QFileInfo info(path); |
| 20 | |
| 21 | if (limit > 0 && depch >= limit) { |
| 22 | return {}; |
| 23 | } |
| 24 | |
| 25 | if (!info.exists()) { |
| 26 | return {}; |
| 27 | } |
| 28 | |
| 29 | auto result = QSet<QString>{}; |
| 30 | |
| 31 | if (!info.isDir()) { |
| 32 | result.insert(getFilePath(info.absoluteFilePath())); |
| 33 | return result; |
| 34 | } |
| 35 | |
| 36 | QDir dir(info.absoluteFilePath()); |
| 37 | auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); |
| 38 | for (const auto &i: std::as_const(list)) { |
| 39 | result.unite(getTree(i.absoluteFilePath(), limit, depch + 1)); |
| 40 | } |
| 41 | |
| 42 | return result; |
| 43 | } |
| 44 | |
| 45 | QSet<QString> TestUtils::getFilesSet(const QString &path, int limit, int depch) { |
| 46 | QFileInfo info(path); |
no outgoing calls
no test coverage detected