CQtDeployer/tests/units/testutils.h

45 lines
1.3 KiB
C
Raw Normal View History

2019-09-23 18:37:17 +03:00
/*
2022-03-09 17:56:42 +03:00
* Copyright (C) 2018-2022 QuasarApp.
2019-09-23 18:37:17 +03:00
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
2019-09-08 14:18:58 +03:00
#ifndef TESTUTILS_H
#define TESTUTILS_H
#include <QSet>
class TestUtils
{
public:
TestUtils();
2019-09-23 14:26:45 +03:00
QSet<QString> getTree(const QString& path, int limit = -1, int depch = 0);
2021-04-21 13:08:18 +03:00
QSet<QString> getFilesSet(const QString& path, int limit = -1, int depch = 0);
QSet<QString> createTree( const QStringList& tree);
2022-10-05 17:05:38 +03:00
QSet<QString> deployTree( const QStringList& tree);
2019-09-08 14:18:58 +03:00
/**
* @brief compareTree - compare 2 tree
* @param leftTree
* @param rightTree
* @return hash with pathes and indexes( 1 - missing left and -1 - missing right)
*/
QHash<QString, int> compareTree(const QSet<QString>& leftTree, const QSet<QString>& rightTree);
2020-03-13 21:49:13 +03:00
/**
* @brief deployFile - deploy one file from recurses
* @param file
* @param distanation
* @return true if operation is seccessful
*/
bool deployFile(const QString& file, const QString& distanation,
const QHash<QByteArray, QByteArray> &replaceCase = {}) const;
private:
QString getFilePath(const QString &i);
2019-09-08 14:18:58 +03:00
};
#endif // TESTUTILS_H