summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-03-17 14:13:59 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-03-21 16:07:53 +0000
commit6d49311a5da483190136209dc902969d1ef4a217 (patch)
tree6762bc94af203e332ecb3cf74430adc45325e407 /src/testlib
parenta9383ef99a29c333a1edd32695ddc29ea0ba805d (diff)
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>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestblacklist.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 587930ca73..0ebc800fe1 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -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;
}