mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-06 14:39:35 +00:00
fix windows tests. and optimisation deploy perfomance (up to 20%)
This commit is contained in:
parent
50e69b8b0e
commit
988d9f8fca
@ -47,21 +47,31 @@ QMultiMap<LibPriority, LibInfo> DependenciesScanner::getLibsFromEnvirement(
|
|||||||
for (const auto & lib : values) {
|
for (const auto & lib : values) {
|
||||||
LibInfo info;
|
LibInfo info;
|
||||||
|
|
||||||
auto priority = (DeployCore::getLibPriority(lib));
|
if (_scanedLibs.contains(lib)) {
|
||||||
|
info = _scanedLibs.value(lib);
|
||||||
|
|
||||||
if ((priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
if ((info.priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
auto priority = (DeployCore::getLibPriority(lib));
|
||||||
|
|
||||||
|
if ((priority >= SystemLib) && !QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
info.setPriority(priority);
|
||||||
|
|
||||||
|
if (!fillLibInfo(info, lib)) {
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
"error extract lib info from " + lib + "(" + libName + ")",
|
||||||
|
QuasarAppUtils::VerboseLvl::Warning);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fillLibInfo(info, lib)) {
|
|
||||||
QuasarAppUtils::Params::log(
|
|
||||||
"error extract lib info from " + lib + "(" + libName + ")",
|
|
||||||
QuasarAppUtils::VerboseLvl::Warning);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
info.setPriority(priority);
|
|
||||||
|
|
||||||
if (!DeployCore::_config->ignoreList.isIgnore(info)) {
|
if (!DeployCore::_config->ignoreList.isIgnore(info)) {
|
||||||
res.insertMulti(info.getPriority(), info);
|
res.insertMulti(info.getPriority(), info);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,10 @@ bool LibInfo::isValid() const {
|
|||||||
name.size() && path.size();
|
name.size() && path.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LibInfo::isScaned() const {
|
||||||
|
return allDep.size();
|
||||||
|
}
|
||||||
|
|
||||||
uint qHash(const LibInfo &info) {
|
uint qHash(const LibInfo &info) {
|
||||||
return qHash(info.fullPath());
|
return qHash(info.fullPath());
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
bool isScaned() const;
|
||||||
|
|
||||||
friend class DependenciesScanner;
|
friend class DependenciesScanner;
|
||||||
const QSet<LibInfo>& getAllDep() const;
|
const QSet<LibInfo>& getAllDep() const;
|
||||||
|
@ -13,5 +13,11 @@ Modules::Modules()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Modules &Modules::instance() {
|
||||||
|
static Modules* val = new Modules();
|
||||||
|
|
||||||
|
return *val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,10 @@
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Modules();
|
Modules();
|
||||||
|
|
||||||
|
static Modules& instance();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TestModule Modules::instance()
|
||||||
|
|
||||||
#endif // MODULES_H
|
#endif // MODULES_H
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,19 +17,19 @@ class ModulesQt513
|
|||||||
public:
|
public:
|
||||||
ModulesQt513();
|
ModulesQt513();
|
||||||
|
|
||||||
static QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter);
|
virtual QSet<QString> ignoreFilter(const QSet<QString>& input, const QString& filter) const;
|
||||||
static QSet<QString> replace(const QSet<QString> &data, const QMap<QString, QString>& replaceMap);
|
virtual QSet<QString> replace(const QSet<QString> &data, const QMap<QString, QString>& replaceMap) const;
|
||||||
|
|
||||||
|
|
||||||
static QSet<QString> onlyC(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> onlyC(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> testDistroLibs(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> testDistroLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> testOutLibs(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> testOutLibs(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
|
||||||
static QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR) const;
|
||||||
static QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR);
|
virtual QSet<QString> testEmptyParamsTree(const QString &distDir = DISTRO_DIR) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -13,13 +13,13 @@ ModulesQt514::ModulesQt514()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtLibs(const QString &distDir)
|
QSet<QString> ModulesQt514::qtLibs(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::qtLibs(distDir);
|
auto res = ModulesQt513::qtLibs(distDir);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
res += utils.createTree({
|
res -= utils.createTree({
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
res += utils.createTree({
|
res += utils.createTree({
|
||||||
@ -29,14 +29,14 @@ QSet<QString> ModulesQt514::qtLibs(const QString &distDir)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::onlyC(const QString &distDir)
|
QSet<QString> ModulesQt514::onlyC(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::onlyC(distDir);
|
auto res = ModulesQt513::onlyC(distDir);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qmlLibs(const QString &distDir)
|
QSet<QString> ModulesQt514::qmlLibs(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ QSet<QString> ModulesQt514::qmlLibs(const QString &distDir)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtWithoutTr(const QString &distDir)
|
QSet<QString> ModulesQt514::qtWithoutTr(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
auto res = ModulesQt513::qtWithoutTr(distDir);
|
auto res = ModulesQt513::qtWithoutTr(distDir);
|
||||||
@ -74,7 +74,7 @@ QSet<QString> ModulesQt514::qtWithoutTr(const QString &distDir)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> ModulesQt514::qtWebEngine(const QString &distDir)
|
QSet<QString> ModulesQt514::qtWebEngine(const QString &distDir) const
|
||||||
{
|
{
|
||||||
TestUtils utils;
|
TestUtils utils;
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ class ModulesQt514 : public ModulesQt513
|
|||||||
public:
|
public:
|
||||||
ModulesQt514();
|
ModulesQt514();
|
||||||
|
|
||||||
static QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> onlyC(const QString &distDir = DISTRO_DIR);
|
QSet<QString> onlyC(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR) const override;
|
||||||
|
|
||||||
static QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qtWithoutTr(const QString &distDir = DISTRO_DIR) const override;
|
||||||
static QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR);
|
QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MODULESQT514_H
|
#endif // MODULESQT514_H
|
||||||
|
@ -510,7 +510,7 @@ void deploytest::testEmptyParamsString() {
|
|||||||
|
|
||||||
// QDir("./" + DISTRO_DIR).removeRecursively();
|
// QDir("./" + DISTRO_DIR).removeRecursively();
|
||||||
|
|
||||||
// auto comapareTree = Modules::testEmptyParamsTree();
|
// auto comapareTree = TestModule.testEmptyParamsTree();
|
||||||
|
|
||||||
// runTestParams({}, &comapareTree);
|
// runTestParams({}, &comapareTree);
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ void deploytest::testEmptyParamsString() {
|
|||||||
|
|
||||||
// runTestParams({"clear"}, &emptyTree);
|
// runTestParams({"clear"}, &emptyTree);
|
||||||
|
|
||||||
// comapareTree = Modules::testEmptyParamsTree("testDeployDir");
|
// comapareTree = TestModule.testEmptyParamsTree("testDeployDir");
|
||||||
|
|
||||||
// runTestParams({"-bin", "./UnitTests",
|
// runTestParams({"-bin", "./UnitTests",
|
||||||
// "-targetDir", "./testDeployDir"}, &comapareTree);
|
// "-targetDir", "./testDeployDir"}, &comapareTree);
|
||||||
@ -538,7 +538,7 @@ void deploytest::testWebEngine() {
|
|||||||
QString bin = TestBinDir + "quicknanobrowser";
|
QString bin = TestBinDir + "quicknanobrowser";
|
||||||
QString qmake = TestQtDir + "bin/qmake";
|
QString qmake = TestQtDir + "bin/qmake";
|
||||||
|
|
||||||
auto comapareTree = Modules::qtWebEngine();
|
auto comapareTree = TestModule.qtWebEngine();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake,
|
"-qmake", qmake,
|
||||||
@ -559,7 +559,7 @@ void deploytest::testExtractPlugins() {
|
|||||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
auto comapareTree = Modules::qmlLibs();
|
auto comapareTree = TestModule.qmlLibs();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake,
|
"-qmake", qmake,
|
||||||
@ -1352,8 +1352,8 @@ void deploytest::testConfFile() {
|
|||||||
QVERIFY(QuasarAppUtils::Params::isEndable("clear"));
|
QVERIFY(QuasarAppUtils::Params::isEndable("clear"));
|
||||||
QVERIFY(QuasarAppUtils::Params::isEndable("bin"));
|
QVERIFY(QuasarAppUtils::Params::isEndable("bin"));
|
||||||
|
|
||||||
comapareTree += Modules::qtLibs();
|
comapareTree += TestModule.qtLibs();
|
||||||
comapareTree += Modules::qmlLibs();
|
comapareTree += TestModule.qmlLibs();
|
||||||
|
|
||||||
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json",
|
runTestParams({"-confFile", TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json",
|
||||||
"-qmake", qmake,
|
"-qmake", qmake,
|
||||||
@ -1366,9 +1366,9 @@ void deploytest::testConfFile() {
|
|||||||
QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json");
|
QFile::remove(TestBinDir + "/../folder/For/Testing/Deploy/File/TestConf.json");
|
||||||
|
|
||||||
// Test generar string in confFile
|
// Test generar string in confFile
|
||||||
comapareTree = Modules::qtLibs();
|
comapareTree = TestModule.qtLibs();
|
||||||
|
|
||||||
comapareTree = Modules::ignoreFilter(comapareTree, "/plugins/p");
|
comapareTree = TestModule.ignoreFilter(comapareTree, "/plugins/p");
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
comapareTree -= utils.createTree(
|
comapareTree -= utils.createTree(
|
||||||
{
|
{
|
||||||
@ -1426,10 +1426,10 @@ void deploytest::testConfFile() {
|
|||||||
QVERIFY(utils.deployFile(":/testResurces/testRes/testMultiPackageConfig.json", file,
|
QVERIFY(utils.deployFile(":/testResurces/testRes/testMultiPackageConfig.json", file,
|
||||||
{{"$BIN_DIR", TestBinDir.toLatin1()}}));
|
{{"$BIN_DIR", TestBinDir.toLatin1()}}));
|
||||||
|
|
||||||
comapareTree = Modules::onlyC(DISTRO_DIR + "/Dstro1") +
|
comapareTree = TestModule.onlyC(DISTRO_DIR + "/Dstro1") +
|
||||||
Modules::qtLibs(DISTRO_DIR + "/Dstro2") +
|
TestModule.qtLibs(DISTRO_DIR + "/Dstro2") +
|
||||||
Modules::qmlLibs(DISTRO_DIR + "/Dstro2") +
|
TestModule.qmlLibs(DISTRO_DIR + "/Dstro2") +
|
||||||
Modules::qtWebEngine(DISTRO_DIR + "/Dstro2");
|
TestModule.qtWebEngine(DISTRO_DIR + "/Dstro2");
|
||||||
|
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
auto qmlDir = TestBinDir + "/../";
|
auto qmlDir = TestBinDir + "/../";
|
||||||
@ -1486,7 +1486,7 @@ void deploytest::testPackages() {
|
|||||||
|
|
||||||
auto packageString = "package1;" + QFileInfo(target1).absoluteFilePath() + ",package2/ZzZ;" + QFileInfo(target2).absoluteFilePath();
|
auto packageString = "package1;" + QFileInfo(target1).absoluteFilePath() + ",package2/ZzZ;" + QFileInfo(target2).absoluteFilePath();
|
||||||
|
|
||||||
comapareTree = Modules::testDistroLibs(DISTRO_DIR);
|
comapareTree = TestModule.testDistroLibs(DISTRO_DIR);
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "force-clear",
|
runTestParams({"-bin", bin, "force-clear",
|
||||||
"-binOut", "/lol",
|
"-binOut", "/lol",
|
||||||
@ -1529,7 +1529,7 @@ void deploytest::testQt() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
auto comapareTree = Modules::qtLibs();
|
auto comapareTree = TestModule.qtLibs();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake}, &comapareTree);
|
"-qmake", qmake}, &comapareTree);
|
||||||
@ -1543,14 +1543,14 @@ void deploytest::testQt() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
comapareTree = Modules::qtWithoutTr();
|
comapareTree = TestModule.qtWithoutTr();
|
||||||
|
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake, "noTranslations"}, &comapareTree);
|
"-qmake", qmake, "noTranslations"}, &comapareTree);
|
||||||
|
|
||||||
|
|
||||||
comapareTree = Modules::qmlLibs();
|
comapareTree = TestModule.qmlLibs();
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
bin = TestBinDir + "TestQMLWidgets";
|
bin = TestBinDir + "TestQMLWidgets";
|
||||||
@ -1682,7 +1682,7 @@ void deploytest::testIgnore() {
|
|||||||
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" }, &comapareTree);
|
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" }, &comapareTree);
|
||||||
|
|
||||||
|
|
||||||
comapareTree = Modules::qtLibs() - removeTree;
|
comapareTree = TestModule.qtLibs() - removeTree;
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake,
|
"-qmake", qmake,
|
||||||
@ -1851,7 +1851,7 @@ void deploytest::testExtraPlugins() {
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto comapareTree = Modules::qtLibs();
|
auto comapareTree = TestModule.qtLibs();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-qmake", qmake,
|
"-qmake", qmake,
|
||||||
@ -2039,7 +2039,7 @@ void deploytest::testSystemLib() {
|
|||||||
QString qmake = TestQtDir + "bin/qmake.exe";
|
QString qmake = TestQtDir + "bin/qmake.exe";
|
||||||
bin = TestBinDir + "QtWidgetsProject.exe";
|
bin = TestBinDir + "QtWidgetsProject.exe";
|
||||||
|
|
||||||
comapareTree += Modules::qtLibs();
|
comapareTree += TestModule.qtLibs();
|
||||||
|
|
||||||
comapareTree -= utils.createTree(
|
comapareTree -= utils.createTree(
|
||||||
{
|
{
|
||||||
@ -2177,7 +2177,7 @@ void deploytest::testOutDirs() {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto comapareTree = Modules::testOutLibs();
|
auto comapareTree = TestModule.testOutLibs();
|
||||||
|
|
||||||
runTestParams({"-bin", bin, "clear" ,
|
runTestParams({"-bin", bin, "clear" ,
|
||||||
"-binOut", "/lol",
|
"-binOut", "/lol",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user