summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2016-10-03 22:18:21 +0300
committerDmitry Shachnev <mitya57@gmail.com>2016-10-04 06:28:05 +0000
commit84b3cf1c0483af7ad200ab33944d8eaa4d4ffa48 (patch)
tree9cd572ed10a3371ee98ef076cb43ff127dcd6310
parentd9aae9ff99d20b58487b0a48801864d13115363b (diff)
downloadqtquickcontrols-84b3cf1c0483af7ad200ab33944d8eaa4d4ffa48.tar.gz
Make tst_customcontrolsstyle pass with custom QML2_IMPORT_PATHv5.7.1
The use case is testing the built package in Debian, when the files are built locally, but not yet installed on the system. Change-Id: Ibe06b33b2d6fb625d3bc65e9f54b6c1407c415c9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index 8405c98b..67aeb586 100644
--- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
+++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
@@ -110,7 +110,12 @@ void tst_customcontrolsstyle::style()
void tst_customcontrolsstyle::changeStyle()
{
qputenv("QT_QUICK_CONTROLS_1_STYLE", "Base");
- qputenv("QML2_IMPORT_PATH", QFile::encodeName(directory()));
+ QByteArray importPath = qgetenv("QML2_IMPORT_PATH");
+ if (importPath.isEmpty())
+ importPath = QFile::encodeName(directory());
+ else
+ importPath.prepend(QFile::encodeName(directory()) + QDir::listSeparator().toLatin1());
+ qputenv("QML2_IMPORT_PATH", importPath);
QQmlEngine engine;