[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [solid] autotests: halbasictest: skip if D-Bus is not running
From:       Pino Toscano <toscano.pino () tiscali ! it>
Date:       2015-03-22 11:22:31
Message-ID: E1YZdxf-0002UA-RG () scm ! kde ! org
[Download RAW message or body]

Git commit 9fbe70458805d5b44527ba4d827e909991e6091a by Pino Toscano.
Committed on 22/03/2015 at 11:21.
Pushed by pino into branch 'master'.

halbasictest: skip if D-Bus is not running

M  +8    -0    autotests/halbasictest.cpp
M  +1    -0    autotests/halbasictest.h

http://commits.kde.org/solid/9fbe70458805d5b44527ba4d827e909991e6091a

diff --git a/autotests/halbasictest.cpp b/autotests/halbasictest.cpp
index 6212d82..f27920f 100644
--- a/autotests/halbasictest.cpp
+++ b/autotests/halbasictest.cpp
@@ -30,6 +30,8 @@
 #include <solid/devices/ifaces/processor.h>
 #include "solid/devices/backends/hal/halprocessor.h"
 
+#include <QtDBus/QDBusConnection>
+
 QTEST_MAIN(HalBasicTest)
 
 HalBasicTest::HalBasicTest(QObject *parent)
@@ -38,6 +40,12 @@ HalBasicTest::HalBasicTest(QObject *parent)
     qputenv("SOLID_HAL_LEGACY", "1");
 }
 
+void HalBasicTest::initTestCase()
+{
+    if (!QDBusConnection::systemBus().isConnected())
+        QSKIP("D-Bus not running");
+}
+
 void HalBasicTest::testBasic()
 {
     Solid::Backends::Hal::HalManager *manager = new Solid::Backends::Hal::HalManager(0);
diff --git a/autotests/halbasictest.h b/autotests/halbasictest.h
index de2067b..7d06999 100644
--- a/autotests/halbasictest.h
+++ b/autotests/halbasictest.h
@@ -33,6 +33,7 @@ class HalBasicTest : public QObject
 public:
     HalBasicTest(QObject *parent = 0);
 private Q_SLOTS:
+    void initTestCase();
     void testBasic();
     void testProcessorList();
     void testDeviceCreation();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic