add tests for battery and gpuload sources

+ some tests refactoring
This commit is contained in:
2016-06-09 12:45:21 +03:00
parent bc2071a493
commit 78b7a87c29
16 changed files with 269 additions and 44 deletions

View File

@ -60,12 +60,13 @@ void TestExtScript::test_run()
// init spy
QSignalSpy spy(extScript, SIGNAL(dataReceived(const QVariantHash &)));
QVariantHash firstValue = extScript->run();
QCOMPARE(firstValue[extScript->tag(QString("custom"))].toString(),
QString(""));
// check values
QVERIFY(spy.wait(5000));
QList<QVariant> arguments = spy.takeFirst();
QCOMPARE(firstValue[extScript->tag(QString("custom"))].toString(),
QString(""));
QCOMPARE(
arguments.at(0).toHash()[extScript->tag(QString("custom"))].toString(),
QString("\n%1").arg(randomString));