mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-19 00:29:57 +00:00
Try to fix test for automatic run with travis
* Additionally calculate valid pressure
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user