add test for awupdatehelper and template for awkeycache

This commit is contained in:
Evgenii Alekseev 2016-06-23 10:56:55 +03:00
parent 4a0da3f978
commit f6a6704fd2
5 changed files with 169 additions and 0 deletions

View File

@ -30,6 +30,7 @@ set(TEST_MODULES
abstractformatter datetimeformatter floatformatter noformatter scriptformatter abstractformatter datetimeformatter floatformatter noformatter scriptformatter
extitemaggregator extitemaggregator
batterysource desktopsource gpuloadsource gputempsource hddtempsource networksource playersource processessource batterysource desktopsource gpuloadsource gputempsource hddtempsource networksource playersource processessource
awkeycache awupdatehelper
dpplugin) dpplugin)
foreach (TEST_MODULE ${TEST_MODULES}) foreach (TEST_MODULE ${TEST_MODULES})
set(${TEST_MODULE}_HEADERS test${TEST_MODULE}.h) set(${TEST_MODULE}_HEADERS test${TEST_MODULE}.h)
@ -37,6 +38,10 @@ foreach (TEST_MODULE ${TEST_MODULES})
if (TEST_MODULE MATCHES "dpplugin") if (TEST_MODULE MATCHES "dpplugin")
set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../desktop-panel/plugin/dpadds.cpp set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../desktop-panel/plugin/dpadds.cpp
${PROJECT_TRDPARTY_DIR}/fontdialog/fontdialog.cpp) ${PROJECT_TRDPARTY_DIR}/fontdialog/fontdialog.cpp)
elseif(TEST_MODULE MATCHES "awkeycache")
set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awkeycache.cpp)
elseif(TEST_MODULE MATCHES "awupdatehelper")
set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../awesome-widget/plugin/awupdatehelper.cpp)
endif(TEST_MODULE MATCHES "dpplugin") endif(TEST_MODULE MATCHES "dpplugin")
add_executable(${SUBPROJECT}-${TEST_MODULE} ${${TEST_MODULE}_HEADERS} ${${TEST_MODULE}_SOURCES}) add_executable(${SUBPROJECT}-${TEST_MODULE} ${${TEST_MODULE}_HEADERS} ${${TEST_MODULE}_SOURCES})
target_link_libraries(${SUBPROJECT}-${TEST_MODULE} ${LIBRARY_TEST_SET}) target_link_libraries(${SUBPROJECT}-${TEST_MODULE} ${LIBRARY_TEST_SET})

View File

@ -0,0 +1,37 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "testawkeycache.h"
#include <QtTest>
#include "awtestlibrary.h"
#include "awkeycache.h"
void TestAWKeyCache::initTestCase()
{
}
void TestAWKeyCache::cleanupTestCase()
{
}
QTEST_MAIN(TestAWKeyCache);

View File

@ -0,0 +1,39 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef TESTAWKEYCACHE_H
#define TESTAWKEYCACHE_H
#include <QObject>
class TestAWKeyCache : public QObject
{
Q_OBJECT
private slots:
// initialization
void initTestCase();
void cleanupTestCase();
// test
private:
};
#endif /* TESTAWKEYCACHE_H */

View File

@ -0,0 +1,45 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "testawupdatehelper.h"
#include <QtTest>
#include "awtestlibrary.h"
#include "awupdatehelper.h"
void TestAWUpdateHelper::initTestCase()
{
plugin = new AWUpdateHelper(this);
}
void TestAWUpdateHelper::cleanupTestCase()
{
delete plugin;
}
void TestAWUpdateHelper::test_checkVersion()
{
QVERIFY(!plugin->checkVersion());
}
QTEST_MAIN(TestAWUpdateHelper);

View File

@ -0,0 +1,43 @@
/***************************************************************************
* This file is part of awesome-widgets *
* *
* awesome-widgets is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* awesome-widgets is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef TESTAWUPDATEHELPER_H
#define TESTAWUPDATEHELPER_H
#include <QObject>
class AWUpdateHelper;
class TestAWUpdateHelper : public QObject
{
Q_OBJECT
private slots:
// initialization
void initTestCase();
void cleanupTestCase();
// test
void test_checkVersion();
private:
AWUpdateHelper *plugin = nullptr;
};
#endif /* TESTAWUPDATEHELPER_H */