diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neptune-qmlscene/neptune-qmlscene.cpp | 6 | ||||
-rw-r--r-- | tests/qmltests/qmltests.pro | 7 | ||||
-rw-r--r-- | tests/qmltests/testrunner.cpp | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/neptune-qmlscene/neptune-qmlscene.cpp b/tests/neptune-qmlscene/neptune-qmlscene.cpp index 74c442e3..b3750875 100644 --- a/tests/neptune-qmlscene/neptune-qmlscene.cpp +++ b/tests/neptune-qmlscene/neptune-qmlscene.cpp @@ -361,6 +361,8 @@ static void usage() puts(" -I <path> ........................ Add <path> to the list of import paths"); puts(" -P <path> ........................ Add <path> to the list of plugin paths"); puts(" -translation <translationfile> ... Set the language to run in"); + puts(" --style-conf <style conf file> ... Sets QT_QUICK_CONTROLS_CONF"); + puts(" --styles-path <styles path> ...... Sets QT_QUICK_CONTROLS_STYLE_PATH"); puts(" "); exit(1); @@ -529,6 +531,10 @@ int main(int argc, char ** argv) imports.append(arguments.at(++i)); else if (lowerArgument == QLatin1String("-p") && i + 1 < size) pluginPaths.append(arguments.at(++i)); + else if (lowerArgument == QLatin1String("--style-conf") && i + 1 < size) + qputenv("QT_QUICK_CONTROLS_CONF", arguments.at(++i).toLocal8Bit()); + else if (lowerArgument == QLatin1String("--styles-path") && i + 1 < size) + qputenv("QT_QUICK_CONTROLS_STYLE_PATH", arguments.at(++i).toLocal8Bit()); else if (lowerArgument == QLatin1String("--help") || lowerArgument == QLatin1String("-help") || lowerArgument == QLatin1String("--h") diff --git a/tests/qmltests/qmltests.pro b/tests/qmltests/qmltests.pro index 0f9768dc..1e90496d 100644 --- a/tests/qmltests/qmltests.pro +++ b/tests/qmltests/qmltests.pro @@ -16,6 +16,11 @@ win32 { CONFIG += qmltestcase +# these defines Styles for qml as it is not possible to set them via Qt Test +# used to set env variables +DEFINES *= STYLE_CONF_PATH=\""\\\"$$BUILD_DIR/styles/neptune/style.conf\\\""\" +DEFINES *= STYLES_PATH=\""\\\"$$BUILD_DIR/styles\\\""\" + # TODO: Check what is the import precedence to ensure Qt looks for modules first in the # build dir and only after in the installation dir. IMPORTPATH = $$BUILD_DIR/imports_shared \ @@ -36,5 +41,7 @@ for(COMPONENT_NAME, COMPONENT_NAMES) { !isEmpty(IMPORTPATH) { for(import, IMPORTPATH): $${targetName}.commands += -I \"$$import\" } + $${targetName}.commands += --style-conf $$BUILD_DIR/styles/neptune/style.conf + $${targetName}.commands += --styles-path $$BUILD_DIR/styles $${targetName}.commands += $$PWD/tst_$${COMPONENT_NAME}.qml } diff --git a/tests/qmltests/testrunner.cpp b/tests/qmltests/testrunner.cpp index 663febe9..1477c373 100644 --- a/tests/qmltests/testrunner.cpp +++ b/tests/qmltests/testrunner.cpp @@ -1,2 +1,6 @@ #include <QtQuickTest/quicktest.h> + +static bool s_styleConfig = qputenv("QT_QUICK_CONTROLS_CONF", STYLE_CONF_PATH); +static bool s_stylesPath = qputenv("QT_QUICK_CONTROLS_STYLE_PATH", STYLES_PATH); + QUICK_TEST_MAIN(neptune-qmltests) |