mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
add test for awupdatehelper and template for awkeycache
This commit is contained in:
parent
4a0da3f978
commit
f6a6704fd2
@ -30,6 +30,7 @@ set(TEST_MODULES
|
||||
abstractformatter datetimeformatter floatformatter noformatter scriptformatter
|
||||
extitemaggregator
|
||||
batterysource desktopsource gpuloadsource gputempsource hddtempsource networksource playersource processessource
|
||||
awkeycache awupdatehelper
|
||||
dpplugin)
|
||||
foreach (TEST_MODULE ${TEST_MODULES})
|
||||
set(${TEST_MODULE}_HEADERS test${TEST_MODULE}.h)
|
||||
@ -37,6 +38,10 @@ foreach (TEST_MODULE ${TEST_MODULES})
|
||||
if (TEST_MODULE MATCHES "dpplugin")
|
||||
set(${TEST_MODULE}_SOURCES ${${TEST_MODULE}_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../desktop-panel/plugin/dpadds.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")
|
||||
add_executable(${SUBPROJECT}-${TEST_MODULE} ${${TEST_MODULE}_HEADERS} ${${TEST_MODULE}_SOURCES})
|
||||
target_link_libraries(${SUBPROJECT}-${TEST_MODULE} ${LIBRARY_TEST_SET})
|
||||
|
37
sources/test/testawkeycache.cpp
Normal file
37
sources/test/testawkeycache.cpp
Normal 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);
|
39
sources/test/testawkeycache.h
Normal file
39
sources/test/testawkeycache.h
Normal 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 */
|
45
sources/test/testawupdatehelper.cpp
Normal file
45
sources/test/testawupdatehelper.cpp
Normal 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);
|
43
sources/test/testawupdatehelper.h
Normal file
43
sources/test/testawupdatehelper.h
Normal 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 */
|
Loading…
Reference in New Issue
Block a user