diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2012-03-16 18:31:00 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-19 03:05:33 +0100 |
commit | 53dc7cbe6e6a67132acfafb5230fe0fc897014cc (patch) | |
tree | b099edaeacac07ff5aa94cd2ce619e346a59bb79 /tests | |
parent | 5fe5a6e97a4e923671483e6d3854e301961415ab (diff) | |
download | qtsensors-53dc7cbe6e6a67132acfafb5230fe0fc897014cc.tar.gz |
Don't use the platform sensors for this unit test.
Turn off plugin loading and supply test backends.
Change-Id: Ib8cf96d26f4e42b3cc48728eae53511430eb3a5a
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsensorgestureplugins/qsensorgestureplugins.pro | 9 | ||||
-rw-r--r-- | tests/auto/qsensorgestureplugins/tst_qsensorgesturepluginstest.cpp | 16 |
2 files changed, 13 insertions, 12 deletions
diff --git a/tests/auto/qsensorgestureplugins/qsensorgestureplugins.pro b/tests/auto/qsensorgestureplugins/qsensorgestureplugins.pro index a0ad023..a8e75e2 100644 --- a/tests/auto/qsensorgestureplugins/qsensorgestureplugins.pro +++ b/tests/auto/qsensorgestureplugins/qsensorgestureplugins.pro @@ -7,3 +7,12 @@ QT -= gui SOURCES += tst_qsensorgesturepluginstest.cpp +VPATH += ../qsensor +INCLUDEPATH += ../qsensor +DEPENDPATH += ../qsensor + +HEADERS += \ + test_backends.h + +SOURCES += \ + test_backends.cpp diff --git a/tests/auto/qsensorgestureplugins/tst_qsensorgesturepluginstest.cpp b/tests/auto/qsensorgestureplugins/tst_qsensorgesturepluginstest.cpp index 3fb139b..7f86fb0 100644 --- a/tests/auto/qsensorgestureplugins/tst_qsensorgesturepluginstest.cpp +++ b/tests/auto/qsensorgestureplugins/tst_qsensorgesturepluginstest.cpp @@ -51,6 +51,8 @@ #include <qsensorgesturerecognizer.h> #include <qsensorgestureplugininterface.h> +#include "test_backends.h" + class Tst_qsensorgesturePluginsTest : public QObject { Q_OBJECT @@ -69,6 +71,8 @@ private Q_SLOTS: Tst_qsensorgesturePluginsTest::Tst_qsensorgesturePluginsTest() { + qputenv("QTSENSORS_LOAD_PLUGINS", "0"); // Do not load plugins + register_test_backends(); } void Tst_qsensorgesturePluginsTest::tst_sensor_plugins_shake() @@ -148,30 +152,18 @@ void Tst_qsensorgesturePluginsTest::tst_sensor_plugins_qtsensors() QVERIFY(gesture->isActive() == true); QVERIFY(gesture2->isActive() == false); - if (gestureId.contains("cover") || gestureId.contains("doubletap") || gestureId.contains("turnover")) { - // prox and tap dont work yet - QEXPECT_FAIL("", QString("fail ok for: " + gestureId).toLocal8Bit(), Continue); - } QVERIFY(recognizer->isActive() == true); gesture2->startDetection(); QVERIFY(gesture->isActive() == true); QVERIFY(gesture2->isActive() == true); - if (gestureId.contains("cover") || gestureId.contains("doubletap") || gestureId.contains("turnover")) { - // prox and tap dont work yet - QEXPECT_FAIL("", QString("fail ok for: " + gestureId).toLocal8Bit(), Continue); - } QVERIFY(recognizer->isActive() == true); gesture2->stopDetection(); QVERIFY(gesture->isActive() == true); QVERIFY(gesture2->isActive() == false); - if (gestureId.contains("cover") || gestureId.contains("doubletap") || gestureId.contains("turnover")) { - // prox and tap dont work yet - QEXPECT_FAIL("", QString("fail ok for: " + gestureId).toLocal8Bit(), Continue); - } QVERIFY(recognizer->isActive() == true); gesture->stopDetection(); |