mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-26 17:54:32 +00:00
added out tests for linux
This commit is contained in:
parent
d30a415f8e
commit
6bc92371e0
@ -614,7 +614,7 @@ bool ConfigParser::smartMoveTargets() {
|
||||
targetPath += _config.distroStruct.getBinOutDir();
|
||||
}
|
||||
|
||||
if (!_fileManager->smartCopyFile(target.absoluteFilePath(), targetPath, _config.targetDir)) {
|
||||
if (!_fileManager->smartCopyFile(target.absoluteFilePath(), targetPath)) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
|
@ -143,10 +143,10 @@ void Extracter::extractPlugins()
|
||||
|
||||
void Extracter::copyFiles()
|
||||
{
|
||||
_fileManager->copyFiles(neadedLibs, DeployCore::_config->targetDir);
|
||||
_fileManager->copyLibs(neadedLibs);
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||
_fileManager->copyFiles(systemLibs, DeployCore::_config->targetDir);
|
||||
_fileManager->copyLibs(systemLibs);
|
||||
}
|
||||
|
||||
if (!QuasarAppUtils::Params::isEndable("noStrip") && !_fileManager->strip(DeployCore::_config->targetDir)) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "filemanager.h"
|
||||
#include <QDir>
|
||||
#include <quasarapp.h>
|
||||
#include "configparser.h"
|
||||
#include "deploycore.h"
|
||||
#include <QProcess>
|
||||
#include <fstream>
|
||||
@ -200,9 +201,10 @@ bool FileManager::removeFile(const QString &file) {
|
||||
return removeFile(QFileInfo (file));
|
||||
}
|
||||
|
||||
bool FileManager::smartCopyFile(const QString &file, const QString &target,
|
||||
const QString& targetDir, QStringList *mask) {
|
||||
if (file.contains(targetDir)) {
|
||||
bool FileManager::smartCopyFile(const QString &file, const QString &target, QStringList *mask) {
|
||||
auto config = DeployCore::_config;
|
||||
|
||||
if (file.contains(config->targetDir)) {
|
||||
if (!moveFile(file, target, mask)) {
|
||||
QuasarAppUtils::Params::verboseLog(" file not moved! try copy");
|
||||
|
||||
@ -313,17 +315,13 @@ void FileManager::clear(const QString& targetDir, bool force) {
|
||||
_deployedFiles.clear();
|
||||
}
|
||||
|
||||
void FileManager::copyFiles(const QStringList &files, const QString& targetDir) {
|
||||
void FileManager::copyLibs(const QStringList &files) {
|
||||
auto config = DeployCore::_config;
|
||||
|
||||
for (auto file : files) {
|
||||
QFileInfo target(file);
|
||||
auto targetPath = targetDir + QDir::separator() + "lib";
|
||||
if (target.completeSuffix().compare("dll", Qt::CaseInsensitive) == 0 ||
|
||||
target.completeSuffix().compare("exe", Qt::CaseInsensitive) == 0) {
|
||||
|
||||
targetPath = targetDir;
|
||||
}
|
||||
|
||||
if (!smartCopyFile(file, targetPath, targetDir)) {
|
||||
if (!smartCopyFile(file, DeployCore::_config->targetDir + config->distroStruct.getLibOutDir())) {
|
||||
QuasarAppUtils::Params::verboseLog(file + " not copied");
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ private:
|
||||
public:
|
||||
FileManager();
|
||||
|
||||
void copyFiles(const QStringList &files, const QString &targetDir);
|
||||
void copyLibs(const QStringList &files);
|
||||
bool copyFile(const QString &file, const QString &target,
|
||||
QStringList *mask = nullptr);
|
||||
|
||||
@ -41,7 +41,7 @@ public:
|
||||
* @param mask
|
||||
* @return if file in target dir try move file else copy
|
||||
*/
|
||||
bool smartCopyFile(const QString &file, const QString &target, const QString &targetDir,
|
||||
bool smartCopyFile(const QString &file, const QString &target,
|
||||
QStringList *mask = nullptr);
|
||||
|
||||
bool moveFile(const QString &file, const QString &target,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1123,6 +1123,22 @@ void deploytest::testOutDirs() {
|
||||
"-qmlDir", TestBinDir + "/../TestQMLWidgets"
|
||||
}, &comapareTree, true);
|
||||
|
||||
QFile file;
|
||||
|
||||
file.setFileName("./" + DISTRO_DIR + "/lol/qt.conf");
|
||||
|
||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||
|
||||
auto runScript = file.readAll();
|
||||
file.close();
|
||||
|
||||
QVERIFY(runScript.contains("Prefix= ./../"));
|
||||
QVERIFY(runScript.contains("Libraries= ./lolLib/"));
|
||||
QVERIFY(runScript.contains("Plugins= ./p/"));
|
||||
QVERIFY(runScript.contains("Imports= ./q/"));
|
||||
QVERIFY(runScript.contains("Translations= ./lolTr/"));
|
||||
QVERIFY(runScript.contains("Qml2Imports= ./q/"));
|
||||
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(deploytest)
|
||||
|
Loading…
x
Reference in New Issue
Block a user