Teach QTestLib to read QTEST_ENVIRONMENT to expand blacklist keywords

Can be used by CI system to set QTEST_ENVIRONMENT="ci", allowing test to
be blacklisted only for the CI.

Task-number: QTBUG-59564
Change-Id: I7088abb888c179bafc621f11191efbc45c37b179
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
bb10
Tor Arne Vestbø 2017-03-17 14:13:59 +01:00
parent a9383ef99a
commit 6d49311a5d
1 changed files with 8 additions and 1 deletions

View File

@ -82,7 +82,9 @@ QT_BEGIN_NAMESPACE
msvc-2010
Keys are lower-case. Distribution name and version are supported if
QSysInfo's productType() and productVersion() return them.
QSysInfo's productType() and productVersion() return them. Keys can be
added via the space-separated QTEST_ENVIRONMENT environment variable.
The other known keys are listed below:
*/
@ -184,6 +186,11 @@ static QSet<QByteArray> activeConditions()
}
}
if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) {
for (const QByteArray &k : qgetenv("QTEST_ENVIRONMENT").split(' '))
result.insert(k);
}
return result;
}