mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-11-04 06:43:41 +00:00 
			
		
		
		
	another iteration with fix travis tests
This commit is contained in:
		@ -18,12 +18,6 @@ arch:
 | 
				
			|||||||
        - cd awesome-widgets/build && make
 | 
					        - cd awesome-widgets/build && make
 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run make test || true
 | 
					        - cd awesome-widgets/build && xvfb-run make test || true
 | 
				
			||||||
        - sleep 3
 | 
					        - sleep 3
 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-extscript || true
 | 
					 | 
				
			||||||
        - sleep 3
 | 
					 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-extweather || true
 | 
					 | 
				
			||||||
        - sleep 3
 | 
					 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-playersource || true
 | 
					 | 
				
			||||||
        - sleep 3
 | 
					 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-awkeys || true
 | 
					        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-awkeys || true
 | 
				
			||||||
        - sleep 3
 | 
					        - sleep 3
 | 
				
			||||||
        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-dpplugin || true
 | 
					        - cd awesome-widgets/build && xvfb-run ./test/awesomewidgets-test-dpplugin || true
 | 
				
			||||||
 | 
				
			|||||||
@ -18,19 +18,30 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "awtestlibrary.h"
 | 
					#include "awtestlibrary.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KWindowSystem>
 | 
				
			||||||
#include <QSet>
 | 
					#include <QSet>
 | 
				
			||||||
#include <QStandardPaths>
 | 
					#include <QStandardPaths>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool AWTestLibrary::isKWinActive()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    KWindowSystem::setShowingDesktop(true);
 | 
				
			||||||
 | 
					    bool state = KWindowSystem::showingDesktop();
 | 
				
			||||||
 | 
					    KWindowSystem::setShowingDesktop(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return state;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
char AWTestLibrary::randomChar()
 | 
					char AWTestLibrary::randomChar()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return 'A' + (rand() % static_cast<int>('Z' - 'A'));
 | 
					    return 'A' + (qrand() % static_cast<int>('Z' - 'A'));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double AWTestLibrary::randomDouble()
 | 
					double AWTestLibrary::randomDouble()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return static_cast<double>(rand()) / static_cast<double>(RAND_MAX);
 | 
					    return static_cast<double>(qrand()) / static_cast<double>(RAND_MAX);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -52,7 +63,7 @@ QPair<QString, QString> AWTestLibrary::randomFilenames()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int AWTestLibrary::randomInt(const int max)
 | 
					int AWTestLibrary::randomInt(const int max)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    return rand() % max;
 | 
					    return qrand() % max;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -25,6 +25,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace AWTestLibrary
 | 
					namespace AWTestLibrary
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					bool isKWinActive();
 | 
				
			||||||
char randomChar();
 | 
					char randomChar();
 | 
				
			||||||
double randomDouble();
 | 
					double randomDouble();
 | 
				
			||||||
QPair<QString, QString> randomFilenames();
 | 
					QPair<QString, QString> randomFilenames();
 | 
				
			||||||
 | 
				
			|||||||
@ -18,7 +18,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "testawkeys.h"
 | 
					#include "testawkeys.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <KWindowSystem>
 | 
					 | 
				
			||||||
#include <QDBusConnection>
 | 
					#include <QDBusConnection>
 | 
				
			||||||
#include <QDBusMessage>
 | 
					#include <QDBusMessage>
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
@ -113,7 +112,7 @@ void TestAWKeys::test_pattern()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TestAWKeys::test_tooltip()
 | 
					void TestAWKeys::test_tooltip()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (!KWindowSystem::workArea().isValid())
 | 
					    if (!AWTestLibrary::isKWinActive())
 | 
				
			||||||
        QSKIP("KWin inactive, skip tooltip test");
 | 
					        QSKIP("KWin inactive, skip tooltip test");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QSignalSpy spy(plugin, SIGNAL(needToolTipToBeUpdated(const QString)));
 | 
					    QSignalSpy spy(plugin, SIGNAL(needToolTipToBeUpdated(const QString)));
 | 
				
			||||||
 | 
				
			|||||||
@ -18,7 +18,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "testdpplugin.h"
 | 
					#include "testdpplugin.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <KWindowSystem>
 | 
					 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "awtestlibrary.h"
 | 
					#include "awtestlibrary.h"
 | 
				
			||||||
@ -28,7 +27,7 @@
 | 
				
			|||||||
void TestDPPlugin::initTestCase()
 | 
					void TestDPPlugin::initTestCase()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    plugin = new DPAdds(this);
 | 
					    plugin = new DPAdds(this);
 | 
				
			||||||
    m_isKwinActive = checkKwinStatus();
 | 
					    m_isKwinActive = AWTestLibrary::isKWinActive();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -114,10 +113,4 @@ void TestDPPlugin::test_tooltipImage()
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TestDPPlugin::checkKwinStatus() const
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    return KWindowSystem::workArea().isValid();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
QTEST_MAIN(TestDPPlugin);
 | 
					QTEST_MAIN(TestDPPlugin);
 | 
				
			||||||
 | 
				
			|||||||
@ -40,7 +40,6 @@ private slots:
 | 
				
			|||||||
    void test_parsePattern();
 | 
					    void test_parsePattern();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    bool checkKwinStatus() const;
 | 
					 | 
				
			||||||
    DPAdds *plugin = nullptr;
 | 
					    DPAdds *plugin = nullptr;
 | 
				
			||||||
    bool m_isKwinActive = false;
 | 
					    bool m_isKwinActive = false;
 | 
				
			||||||
    QString pattern = QString("$");
 | 
					    QString pattern = QString("$");
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user