mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-07 06:59:35 +00:00
Merge branch 'v1.2' into v1.3
This commit is contained in:
commit
fb9950f4da
@ -249,7 +249,7 @@ bool ConfigParser::parseQtInfoMode() {
|
||||
}
|
||||
|
||||
bool ConfigParser::parseQtClearMode() {
|
||||
setTargetDir("./");
|
||||
setTargetDir("./" + DISTRO_DIR);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -263,9 +263,9 @@ void ConfigParser::setTargetDir(const QString &target) {
|
||||
} else {
|
||||
if (_config.targets.size())
|
||||
_config.targetDir = QFileInfo(
|
||||
_config.targets.begin().key()).absolutePath() + "/Distro";
|
||||
_config.targets.begin().key()).absolutePath() + "/" + DISTRO_DIR;
|
||||
|
||||
_config.targetDir = QFileInfo("./Distro").absoluteFilePath();
|
||||
_config.targetDir = QFileInfo("./" + DISTRO_DIR).absoluteFilePath();
|
||||
qInfo () << "flag targetDir not used." << "use default target dir :" << _config.targetDir;
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include <QDir>
|
||||
#include "deploy_global.h"
|
||||
|
||||
#define DISTRO_DIR QString("DistributionKit")
|
||||
|
||||
class FileManager;
|
||||
|
||||
struct DEPLOYSHARED_EXPORT DeployConfig {
|
||||
|
@ -52,12 +52,18 @@ bool Deploy::prepare() {
|
||||
|
||||
int Deploy::deploy() {
|
||||
|
||||
if (DeployCore::getMode() != RunMode::Deploy) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
_fileManager->loadDeployemendFiles(_paramsParser->config()->targetDir);
|
||||
_extracter->deploy();
|
||||
|
||||
switch (DeployCore::getMode() ) {
|
||||
case RunMode::Deploy:
|
||||
_extracter->deploy();
|
||||
break;
|
||||
case RunMode::Clear:
|
||||
_extracter->clear();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_fileManager->saveDeploymendFiles(_paramsParser->config()->targetDir);
|
||||
|
||||
return 0;
|
||||
|
@ -142,7 +142,7 @@ RunMode DeployCore::getMode() {
|
||||
return RunMode::Info;
|
||||
}
|
||||
|
||||
if (C("bin") || C("binDir")) {
|
||||
if (QuasarAppUtils::Params::customParamasSize() == 0 || C("bin") || C("binDir")) {
|
||||
return RunMode::Deploy;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,6 @@ class DEPLOYSHARED_EXPORT Extracter {
|
||||
|
||||
void extractAllTargets();
|
||||
void initQtModules();
|
||||
void clear();
|
||||
void extractPlugins();
|
||||
void copyFiles();
|
||||
void copyTr();
|
||||
@ -58,6 +57,7 @@ class DEPLOYSHARED_EXPORT Extracter {
|
||||
public:
|
||||
explicit Extracter(FileManager *fileManager, ConfigParser * cqt);
|
||||
void deploy();
|
||||
void clear();
|
||||
|
||||
friend class deploytest;
|
||||
};
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 723dd9321a7b08c48e5ffc6b5788edf25781b70c
|
||||
Subproject commit e4ed4419bc446dec76ec1c9516ef1bb13d639a55
|
File diff suppressed because it is too large
Load Diff
@ -105,6 +105,8 @@ private slots:
|
||||
|
||||
void testMSVC();
|
||||
|
||||
void testEmptyParamsString();
|
||||
|
||||
};
|
||||
|
||||
bool deploytest::runProcess(const QString &DistroPath,
|
||||
@ -440,6 +442,42 @@ void deploytest::testMSVC() {
|
||||
|
||||
}
|
||||
|
||||
void deploytest::testEmptyParamsString() {
|
||||
TestUtils utils;
|
||||
|
||||
#ifdef QT_CREATOR
|
||||
|
||||
QDir("./" + DISTRO_DIR).removeRecursively();
|
||||
|
||||
auto comapareTree = utils.createTree({
|
||||
"./DistributionKit/UnitTests.sh",
|
||||
"./DistributionKit/bin/UnitTests",
|
||||
});
|
||||
|
||||
runTestParams({}, &comapareTree);
|
||||
|
||||
|
||||
comapareTree = utils.createTree({});
|
||||
|
||||
runTestParams({"clear"}, &comapareTree);
|
||||
|
||||
comapareTree = utils.createTree({
|
||||
"./DistributionKit/UnitTests.sh",
|
||||
"./DistributionKit/bin/UnitTests",
|
||||
});
|
||||
|
||||
|
||||
runTestParams({"-bin", "./UnitTests"
|
||||
"-targetDor", "./testDeployDir"}, &comapareTree);
|
||||
|
||||
|
||||
comapareTree = utils.createTree({});
|
||||
|
||||
runTestParams({"clear", "-targetDor", "./testDeployDir"}, &comapareTree);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void deploytest::testQmlExtrct() {
|
||||
QmlCreator creator("./");
|
||||
auto imports = creator.getQmlImports();
|
||||
@ -501,19 +539,18 @@ void deploytest::testSetTargetDir() {
|
||||
|
||||
dep.setTargetDir();
|
||||
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./Distro").absoluteFilePath());
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./" + DISTRO_DIR + "").absoluteFilePath());
|
||||
dep.setTargetDir("./ff");
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./ff").absoluteFilePath());
|
||||
|
||||
int argc = 3;
|
||||
const char * argv[] = {"", "-targetDir", "./Distro2"};
|
||||
QStringList argv = {"-targetDir", "./" + DISTRO_DIR + "2"};
|
||||
|
||||
QuasarAppUtils::Params::parseParams(argc, argv);
|
||||
QuasarAppUtils::Params::parseParams(argv);
|
||||
|
||||
dep.setTargetDir();
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./Distro2").absoluteFilePath());
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./" + DISTRO_DIR + "2").absoluteFilePath());
|
||||
dep.setTargetDir("./ff");
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./Distro2").absoluteFilePath());
|
||||
QVERIFY(dep.config()->targetDir == QFileInfo("./" + DISTRO_DIR + "2").absoluteFilePath());
|
||||
|
||||
}
|
||||
|
||||
@ -595,17 +632,17 @@ void deploytest::testOverwrite() {
|
||||
TestUtils utils;
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
QFile f("./Distro/bin/TestOnlyC");
|
||||
QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC");
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/bin/TestOnlyC",
|
||||
"./Distro/TestOnlyC.sh"});
|
||||
{"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh"});
|
||||
QString bin = TestBinDir + "TestOnlyC";
|
||||
|
||||
#else
|
||||
QFile f("./Distro/TestOnlyC.exe");
|
||||
QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe");
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/TestOnlyC.exe",
|
||||
"./Distro/qt.conf"});
|
||||
{"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/qt.conf"});
|
||||
QString bin = TestBinDir + "TestOnlyC.exe";
|
||||
|
||||
#endif
|
||||
@ -651,18 +688,18 @@ void deploytest::testBinDir() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/bin/TestOnlyC",
|
||||
"./Distro/bin/QtWidgetsProject",
|
||||
"./Distro/bin/TestQMLWidgets",
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/QtWidgetsProject.sh",
|
||||
"./Distro/TestQMLWidgets.sh"});
|
||||
{"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/bin/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/bin/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.sh",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.sh"});
|
||||
#else
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/TestOnlyC.exe",
|
||||
"./Distro/QtWidgetsProject.exe",
|
||||
"./Distro/TestQMLWidgets.exe",
|
||||
"./Distro/qt.conf"});
|
||||
{"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/qt.conf"});
|
||||
#endif
|
||||
|
||||
|
||||
@ -677,18 +714,18 @@ void deploytest::testConfFile() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/bin/TestOnlyC",
|
||||
"./Distro/bin/QtWidgetsProject",
|
||||
"./Distro/bin/TestQMLWidgets",
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/QtWidgetsProject.sh",
|
||||
"./Distro/TestQMLWidgets.sh"});
|
||||
{"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/bin/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/bin/TestQMLWidgets",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.sh",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.sh"});
|
||||
#else
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./Distro/TestOnlyC.exe",
|
||||
"./Distro/QtWidgetsProject.exe",
|
||||
"./Distro/TestQMLWidgets.exe",
|
||||
"./Distro/qt.conf"});
|
||||
{"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.exe",
|
||||
"./" + DISTRO_DIR + "/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/qt.conf"});
|
||||
#endif
|
||||
|
||||
|
||||
@ -779,8 +816,8 @@ void deploytest::testQt() {
|
||||
|
||||
#else
|
||||
comapareTree = utils.createTree(
|
||||
{"./Distro/TestQMLWidgets.exe",
|
||||
"./Distro/qt.conf"});
|
||||
{"./" + DISTRO_DIR + "/TestQMLWidgets.exe",
|
||||
"./" + DISTRO_DIR + "/qt.conf"});
|
||||
bin = TestBinDir + "QtWidgetsProject.exe";
|
||||
|
||||
#endif
|
||||
@ -806,11 +843,11 @@ void deploytest::testIgnore() {
|
||||
|
||||
auto comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/QtWidgetsProject.sh",
|
||||
"./Distro/bin/QtWidgetsProject",
|
||||
"./Distro/lib/libicudata.so",
|
||||
"./Distro/lib/libicui18n.so",
|
||||
"./Distro/lib/libicuuc.so"
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.sh",
|
||||
"./" + DISTRO_DIR + "/bin/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/lib/libicudata.so",
|
||||
"./" + DISTRO_DIR + "/lib/libicui18n.so",
|
||||
"./" + DISTRO_DIR + "/lib/libicuuc.so"
|
||||
});
|
||||
|
||||
|
||||
@ -820,8 +857,8 @@ void deploytest::testIgnore() {
|
||||
|
||||
comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/QtWidgetsProject.sh",
|
||||
"./Distro/bin/QtWidgetsProject",
|
||||
"./" + DISTRO_DIR + "/QtWidgetsProject.sh",
|
||||
"./" + DISTRO_DIR + "/bin/QtWidgetsProject",
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
@ -829,7 +866,7 @@ void deploytest::testIgnore() {
|
||||
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" }, &comapareTree);
|
||||
|
||||
auto removeTree = utils.createTree({
|
||||
"./Distro/lib/libQt5VirtualKeyboard.so",
|
||||
"./" + DISTRO_DIR + "/lib/libQt5VirtualKeyboard.so",
|
||||
});
|
||||
|
||||
comapareTree = Modules::qtLibs() - removeTree;
|
||||
@ -855,8 +892,8 @@ void deploytest::testLibDir() {
|
||||
|
||||
auto comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/bin/TestOnlyC"
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC"
|
||||
});
|
||||
|
||||
|
||||
@ -866,10 +903,10 @@ void deploytest::testLibDir() {
|
||||
|
||||
comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/bin/TestOnlyC",
|
||||
"./Distro/lib/libstdc++.so",
|
||||
"./Distro/lib/libgcc_s.so"
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/lib/libstdc++.so",
|
||||
"./" + DISTRO_DIR + "/lib/libgcc_s.so"
|
||||
});
|
||||
|
||||
|
||||
@ -906,10 +943,9 @@ void deploytest::testExtraPlugins() {
|
||||
|
||||
auto pluginTree = utils.createTree(
|
||||
{
|
||||
"./Distro/plugins/sqldrivers/libqsqlodbc.so",
|
||||
"./Distro/plugins/sqldrivers/libqsqlpsql.so",
|
||||
"./Distro/plugins/sqldrivers/libqsqlite.so",
|
||||
"./Distro/lib/libQt5Sql.so",
|
||||
"./" + DISTRO_DIR + "/plugins/sqldrivers/libqsqlodbc.so",
|
||||
"./" + DISTRO_DIR + "/plugins/sqldrivers/libqsqlpsql.so",
|
||||
"./" + DISTRO_DIR + "/plugins/sqldrivers/libqsqlite.so",
|
||||
});
|
||||
|
||||
comapareTree = comapareTree + pluginTree;
|
||||
@ -933,11 +969,11 @@ void deploytest::testTargetDir() {
|
||||
#endif
|
||||
|
||||
auto comapareTree = utils.createTree(
|
||||
{"./DistroZ/bin/TestOnlyC",
|
||||
"./DistroZ/TestOnlyC.sh"});
|
||||
{"./" + DISTRO_DIR + "Z/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "Z/TestOnlyC.sh"});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"-targetDir", "./DistroZ"
|
||||
"-targetDir", "./" + DISTRO_DIR + "Z"
|
||||
}, &comapareTree);
|
||||
}
|
||||
|
||||
@ -955,13 +991,13 @@ void deploytest::testSystemLib() {
|
||||
|
||||
auto comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/bin/TestOnlyC",
|
||||
"./Distro/lib/ld-linux-x86-64.so",
|
||||
"./Distro/lib/libc.so",
|
||||
"./Distro/lib/libgcc_s.so",
|
||||
"./Distro/lib/libm.so",
|
||||
"./Distro/lib/libstdc++.so"
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/lib/ld-linux-x86-64.so",
|
||||
"./" + DISTRO_DIR + "/lib/libc.so",
|
||||
"./" + DISTRO_DIR + "/lib/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/libm.so",
|
||||
"./" + DISTRO_DIR + "/lib/libstdc++.so"
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
@ -970,7 +1006,7 @@ void deploytest::testSystemLib() {
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
|
||||
QFile file("./Distro/TestOnlyC.sh");
|
||||
QFile file("./" + DISTRO_DIR + "/TestOnlyC.sh");
|
||||
|
||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||
|
||||
@ -981,17 +1017,17 @@ void deploytest::testSystemLib() {
|
||||
|
||||
comapareTree = utils.createTree(
|
||||
{
|
||||
"./Distro/TestOnlyC.sh",
|
||||
"./Distro/bin/TestOnlyC",
|
||||
"./Distro/lib/libgcc_s.so",
|
||||
"./Distro/lib/libstdc++.so"
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/lib/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/libstdc++.so"
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
"deploySystem", "noLibc"
|
||||
}, &comapareTree, true);
|
||||
|
||||
file.setFileName("./Distro/TestOnlyC.sh");
|
||||
file.setFileName("./" + DISTRO_DIR + "/TestOnlyC.sh");
|
||||
|
||||
QVERIFY(file.open(QIODevice::ReadOnly));
|
||||
|
||||
|
2
test.pri
2
test.pri
@ -9,6 +9,7 @@ contains(QMAKE_HOST.os, Linux):{
|
||||
|
||||
deployTest.commands = cqtdeployer -bin $$exec clear -qmake $$QMAKE_BIN -targetDir $$PWD/deployTests -libDir $$PWD -recursiveDepth 4
|
||||
|
||||
|
||||
test.depends = deployTest
|
||||
unix:test.commands = $$PWD/deployTests/UnitTests.sh -maxwarnings 100000
|
||||
win32:test.commands = $$PWD/deployTests/UnitTests.exe -maxwarnings 100000
|
||||
@ -17,3 +18,4 @@ QMAKE_EXTRA_TARGETS += \
|
||||
deployTest \
|
||||
test
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user