summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-03-17 14:13:59 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-06-21 13:30:45 +0000
commitfd301f9289b6c7d0ddc1c97c00540a2844f2ac50 (patch)
treeb4e75ebfe7fb1a6f0b2d958eb6614470078c4344
parent394e0c8a8edbb0b3147f3ad20fde1ecef64323da (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> (cherry picked from commit 6d49311a5da483190136209dc902969d1ef4a217) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-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 9dfd5065ad..28f081c21c 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -76,7 +76,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:
*/
@@ -168,6 +170,11 @@ static QSet<QByteArray> activeConditions()
}
}
+ if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) {
+ foreach (const QByteArray &k, qgetenv("QTEST_ENVIRONMENT").split(' '))
+ result.insert(k);
+ }
+
return result;
}