fix tests of noLibC

This commit is contained in:
Andrei Yankovich 2019-09-23 14:26:45 +03:00
parent f70abe8def
commit 888e6c887d
5 changed files with 13 additions and 8 deletions

View File

@ -386,8 +386,6 @@ void ConfigParser::initIgnoreList()
return rule;
};
rule.label = "libc";
_config.ignoreList.addRule(addRule("libc"));
_config.ignoreList.addRule(addRule("ld-"));
_config.ignoreList.addRule(addRule("libpthread"));

View File

@ -32,9 +32,9 @@ bool IgnoreRule::isIgnore(const LibInfo &info) const {
for (auto &ignore : _data) {
bool checkPlatform = ignore.platform == info.getPlatform() || ignore.platform == UnknownPlatform;
bool checkPriority = ignore.prority <= info.getPriority();
bool checkEnvirement = ignore.enfirement.inThisEnvirement(info.fullPath());
bool checkPlatform = ((ignore.platform & info.getPlatform()) == info.getPlatform()) || ignore.platform == UnknownPlatform;
bool checkPriority = ignore.prority >= info.getPriority();
bool checkEnvirement = !ignore.enfirement.size() || ignore.enfirement.inThisEnvirement(info.fullPath());
if (checkPlatform && checkPriority && checkEnvirement) {
return check(info, ignore.label);

View File

@ -8,9 +8,13 @@ TestUtils::TestUtils()
}
QSet<QString> TestUtils::getTree(const QString &path) {
QSet<QString> TestUtils::getTree(const QString &path, int limit, int depch) {
QFileInfo info(path);
if (limit > 0 && depch >= limit) {
return {};
}
if (!info.exists()) {
return {};
}
@ -25,7 +29,7 @@ QSet<QString> TestUtils::getTree(const QString &path) {
QDir dir(info.absoluteFilePath());
auto list = dir.entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot);
for (auto &i: list) {
result.unite(getTree(i.absoluteFilePath()));
result.unite(getTree(i.absoluteFilePath(), limit, depch + 1));
}
return result;

View File

@ -7,7 +7,7 @@ class TestUtils
{
public:
TestUtils();
QSet<QString> getTree( const QString& path);
QSet<QString> getTree(const QString& path, int limit = -1, int depch = 0);
QSet<QString> createTree( const QStringList& tree);
/**

View File

@ -187,6 +187,9 @@ deploytest::deploytest() {
auto tempTree = utils.getTree(TestQtDir);
tempTree += utils.getTree("/lib", 4);
tempTree += utils.getTree("/usr/lib", 4);
for (const QString &i: tempTree) {
qtFilesTree.insert(QFileInfo(i).fileName());
}