aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--debian/control10
-rwxr-xr-xdebian/rules15
-rw-r--r--tests/client/CMakeLists.txt1
-rw-r--r--tests/client/actiongrouptest.cpp2
-rw-r--r--tests/client/convertertest.cpp2
-rw-r--r--tests/client/menuchangestest.cpp2
-rw-r--r--tests/client/modeltest.cpp2
-rw-r--r--tests/client/qmltest.cpp4
-rw-r--r--tests/client/servicetest.cpp2
10 files changed, 34 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 261335a..d22194c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,16 @@ endif()
add_subdirectory(libqmenumodel)
# Tests Tools
+set(XVFB_EXEC "")
+option(USE_XVFB "Uses xvfb-run with the unit tests to avoid QtWidgets tests fails without X." FALSE)
+if(USE_XVFB)
+ find_program(XVFB_RUN NAMES xvfb-run)
+ if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
+ set(XVFB_EXEC ${XVFB_RUN} -a)
+ message(STATUS "Using xvfb-run to perform QtWidget tests.")
+ endif()
+endif()
+
if(NOT DBUS_RUNNER)
message(STATUS "dbus-test-runner not found tests disabled.")
else()
diff --git a/debian/control b/debian/control
index 0e5d4c1..e4e9d1c 100644
--- a/debian/control
+++ b/debian/control
@@ -2,13 +2,17 @@ Source: qmenumodel
Section: libs
Priority: optional
Maintainer: Renato Araujo Oliveira Filho <renato@canonical.com>
-Build-Depends: debhelper (>= 8.0.0),
- cdbs,
+Build-Depends: debhelper (>= 9.0.0),
cmake (>= 2.8.9),
libglib2.0-dev,
qtbase (>= 5.0),
qtdeclarative (>= 5.0),
-Standards-Version: 3.9.2
+ python3,
+ dbus-test-runner,
+ libgles2-mesa-dev,
+ libgl-dev,
+ xvfb,
+Standards-Version: 3.9.3
Package: libqmenumodel0
Section: libs
diff --git a/debian/rules b/debian/rules
index 7e8093d..366a447 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,10 +1,15 @@
#!/usr/bin/make -f
# -*- makefile -*-
-DEB_CMAKE_EXTRA_FLAGS = -DCMAKE_PREFIX_PATH=/opt/qt5/lib/cmake
-DEB_DH_MAKESHLIBS_ARGS_qmenumodel-qml = -Xlibqmenumodel-qml.so
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/utils.mk
-include /usr/share/cdbs/1/class/cmake.mk
+override_dh_auto_configure:
+ PATH=/opt/qt5/bin:${PATH} dh_auto_configure -- -DUSE_XVFB=On
+
+override_dh_makeshlibs:
+ dh_makeshlibs -Xlibqmenumodel-qml.so
+
+%:
+ dh $@ --parallel
diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt
index 9bce370..9209cc8 100644
--- a/tests/client/CMakeLists.txt
+++ b/tests/client/CMakeLists.txt
@@ -9,6 +9,7 @@ macro(declare_test testname)
)
add_test(${testname}
+ ${XVFB_EXEC}
${DBUS_RUNNER}
--task ${CMAKE_CURRENT_BINARY_DIR}/${testname} --task-name Client
--task ${CMAKE_CURRENT_SOURCE_DIR}/script_${testname}.py --task-name Server
diff --git a/tests/client/actiongrouptest.cpp b/tests/client/actiongrouptest.cpp
index 116bd44..96d6916 100644
--- a/tests/client/actiongrouptest.cpp
+++ b/tests/client/actiongrouptest.cpp
@@ -24,7 +24,7 @@
#include <QObject>
#include <QSignalSpy>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
class ActionGroupTest : public QObject
diff --git a/tests/client/convertertest.cpp b/tests/client/convertertest.cpp
index 633ecf1..5301653 100644
--- a/tests/client/convertertest.cpp
+++ b/tests/client/convertertest.cpp
@@ -24,7 +24,7 @@ extern "C" {
#include "converter.h"
#include <QObject>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
class ConverterTest : public QObject
diff --git a/tests/client/menuchangestest.cpp b/tests/client/menuchangestest.cpp
index 2015582..ee7cf62 100644
--- a/tests/client/menuchangestest.cpp
+++ b/tests/client/menuchangestest.cpp
@@ -22,7 +22,7 @@
#include <QObject>
#include <QSignalSpy>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
class MenuChangesTest : public QObject
diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp
index 93677db..02ce8ca 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -22,7 +22,7 @@
#include <QObject>
#include <QSignalSpy>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
class ModelTest : public QObject
diff --git a/tests/client/qmltest.cpp b/tests/client/qmltest.cpp
index 4e6f288..2dfc356 100644
--- a/tests/client/qmltest.cpp
+++ b/tests/client/qmltest.cpp
@@ -27,7 +27,7 @@ extern "C" {
#include <QObject>
#include <QSignalSpy>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
#include <QQmlContext>
@@ -78,7 +78,6 @@ private Q_SLOTS:
view->engine()->rootContext()->setContextProperty("globalBusName", MENU_SERVICE_NAME);
view->engine()->rootContext()->setContextProperty("globalObjectPath", MENU_OBJECT_PATH);
view->setSource(QUrl::fromLocalFile(LOADMODEL_QML));
- view->show();
QTest::qWait(500);
view->engine()->rootContext()->setContextProperty("resetModel", true);
QTest::qWait(500);
@@ -100,7 +99,6 @@ private Q_SLOTS:
view->engine()->rootContext()->setContextProperty("globalBusName", MENU_SERVICE_NAME);
view->engine()->rootContext()->setContextProperty("globalObjectPath", MENU_OBJECT_PATH);
view->setSource(QUrl::fromLocalFile(LOADMODEL2_QML));
- view->show();
QTest::qWait(500);
m_script.unpublishMenu();
diff --git a/tests/client/servicetest.cpp b/tests/client/servicetest.cpp
index a8b0c2a..262eacf 100644
--- a/tests/client/servicetest.cpp
+++ b/tests/client/servicetest.cpp
@@ -22,7 +22,7 @@
#include <QObject>
#include <QSignalSpy>
-#include <QtTestGui>
+#include <QtTest>
#include <QDebug>
class ServiceTest : public QObject