From 6d49311a5da483190136209dc902969d1ef4a217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 17 Mar 2017 14:13:59 +0100 Subject: 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 Reviewed-by: Paul Olav Tvete --- src/testlib/qtestblacklist.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/testlib') 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 activeConditions() } } + if (qEnvironmentVariableIsSet("QTEST_ENVIRONMENT")) { + for (const QByteArray &k : qgetenv("QTEST_ENVIRONMENT").split(' ')) + result.insert(k); + } + return result; } -- cgit v1.2.3