Try to fix test for automatic run with travis

* Additionally calculate valid pressure
This commit is contained in:
2017-02-13 21:04:03 +03:00
parent d097e154ff
commit 10f556e41b
8 changed files with 54 additions and 17 deletions

View File

@ -28,6 +28,7 @@
void TestDPPlugin::initTestCase()
{
plugin = new DPAdds(this);
m_isKwinActive = checkKwinStatus();
}
@ -39,6 +40,9 @@ void TestDPPlugin::cleanupTestCase()
void TestDPPlugin::test_desktops()
{
if (!m_isKwinActive)
QSKIP("KWin inactive, skip tests");
int current = plugin->currentDesktop();
int total = plugin->numberOfDesktops();
QVERIFY(total != 0);
@ -62,6 +66,9 @@ void TestDPPlugin::test_desktops()
void TestDPPlugin::test_dictKeys()
{
if (!m_isKwinActive)
QSKIP("KWin inactive, skip tests");
QCOMPARE(plugin->dictKeys().count(), 4);
pattern += plugin->dictKeys().join(QString(" $"));
}
@ -69,6 +76,9 @@ void TestDPPlugin::test_dictKeys()
void TestDPPlugin::test_infoByKey()
{
if (!m_isKwinActive)
QSKIP("KWin inactive, skip tests");
// nothing to test here yet
QVERIFY(true);
}
@ -76,6 +86,9 @@ void TestDPPlugin::test_infoByKey()
void TestDPPlugin::test_parsePattern()
{
if (!m_isKwinActive)
QSKIP("KWin inactive, skip tests");
QString result = plugin->parsePattern(pattern, plugin->currentDesktop());
QVERIFY(!result.isEmpty());
QVERIFY(result != pattern);
@ -86,6 +99,9 @@ void TestDPPlugin::test_parsePattern()
void TestDPPlugin::test_tooltipImage()
{
if (!m_isKwinActive)
QSKIP("KWin inactive, skip tests");
QVariantMap data;
data[QString("tooltipColor")] = QString("#000000");
data[QString("tooltipType")] = QString("windows");
@ -98,4 +114,10 @@ void TestDPPlugin::test_tooltipImage()
}
bool TestDPPlugin::checkKwinStatus() const
{
return KWindowSystem::workArea().isValid();
}
QTEST_MAIN(TestDPPlugin);