ref #422 fixed tests on linux

This commit is contained in:
Andrei Yankovich 2020-10-14 13:17:26 +03:00
parent 7b3071e0af
commit e151550e59
7 changed files with 39 additions and 8 deletions

View File

@ -1139,7 +1139,7 @@ void ConfigParser::initExtraNames() {
*
*/
if (isNeededQt()) {
auto libs = DeployCore::Qt3rdpartyLibs( _config.getPlatform(""));
auto libs = DeployCore::Qt3rdpartyLibs( _config.getPlatformOfAll());
deployExtraNames(libs);
}
}

View File

@ -65,18 +65,19 @@ Platform DeployConfig::getPlatform(const QString& package) const {
for( auto it = disto.targets().cbegin(); it != disto.targets().cend(); ++it) {
result = result | _targets.value(*it).getPlatform();
}
return result;
}
return result;
}
Platform DeployConfig::getPlatformOfAll() const {
Platform result = Platform::UnknownPlatform;
for( auto it = _targets.cbegin(); it != _targets.cend(); ++it) {
result = result | it.value().getPlatform();
}
return result;
}
const QHash<QString, TargetInfo> &DeployConfig::targets() const {

View File

@ -89,12 +89,17 @@ public:
/**
* @brief getPlatform This method return a platform of distribution.
* If you set a pacakge name then this method return platform of package.
* IF package name is empty or not exits then method return platform for all distribution.
* @param package This is name of pacakge. Set this parameter to empty string for get a distribution of all pacakges.
* @return platform of distribution.
*/
Platform getPlatform(const QString& package) const;
/**
* @brief getPlatformOfAll This method return paltform of all targets of distributuon.
* @return platform of all targets.
*/
Platform getPlatformOfAll() const;
private:
/**

View File

@ -513,13 +513,17 @@ QString DeployCore::getMSVCVersion(MSVCVersion msvc) {
}
bool DeployCore::isQtLib(const QString &lib) {
QFileInfo info((lib));
QFileInfo info(lib);
/*
* Task https://github.com/QuasarApp/CQtDeployer/issues/422
* All qt libs need to contains the Qt label.
*/
bool isQt = isLib(info) && info.fileName().contains("Qt", ONLY_WIN_CASE_INSENSIATIVE);
if (_config) {
isQt = isQt && _config->qtDir.isQt(info.absoluteFilePath());
}
if (isQt && QuasarAppUtils::Params::isEndable("noQt") &&
!QuasarAppUtils::Params::isEndable("qmake")) {
return false;

View File

@ -65,3 +65,17 @@ Platform QtDir::getQtPlatform() const {
void QtDir::setQtPlatform(const Platform &value) {
qtPlatform = value;
}
bool QtDir::isQt(QString path) const {
path = PathUtils::fixPath(path);
return
(!libs.isEmpty() && path.contains(libs)) ||
(!bins.isEmpty() && path.contains(bins)) ||
(!libexecs.isEmpty() && path.contains(libexecs)) ||
(!plugins.isEmpty() && path.contains(plugins)) ||
(!qmls.isEmpty() && path.contains(qmls)) ||
(!translations.isEmpty() && path.contains(translations)) ||
(!resources.isEmpty() && path.contains(resources));
}

View File

@ -35,6 +35,12 @@ public:
Platform getQtPlatform() const;
void setQtPlatform(const Platform &value);
/**
* @brief isQt - This method check a path for belonging to QtDirs.
* @param path This is cheecked path of library or any qt file.
* @return true if object is qt.
*/
bool isQt(QString path) const;
};
#endif // QTDIR_H

View File

@ -1598,7 +1598,8 @@ void deploytest::testIgnore() {
runTestParams({"-bin", bin, "clear" ,
"-qmake", qmake,
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" }, &comapareTree);
"-ignoreEnv", TestQtDir + "/lib," + TestQtDir + "/bin" },
&comapareTree);
comapareTree = TestModule.qtLibs() - removeTree;