[preservefiles] Add (stub) tests
This commit is contained in:
parent
90f6ea1fc8
commit
8b5e49d980
@ -3,8 +3,6 @@
|
|||||||
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
#
|
#
|
||||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
|
||||||
|
|
||||||
calamares_add_plugin( preservefiles
|
calamares_add_plugin( preservefiles
|
||||||
TYPE job
|
TYPE job
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
@ -15,3 +13,10 @@ calamares_add_plugin( preservefiles
|
|||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
EMERGENCY
|
EMERGENCY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
calamares_add_test(
|
||||||
|
preservefilestest
|
||||||
|
SOURCES
|
||||||
|
Item.cpp
|
||||||
|
Tests.cpp
|
||||||
|
)
|
||||||
|
70
src/modules/preservefiles/Tests.cpp
Normal file
70
src/modules/preservefiles/Tests.cpp
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Item.h"
|
||||||
|
|
||||||
|
#include "Settings.h"
|
||||||
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/Yaml.h"
|
||||||
|
|
||||||
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
class PreserveFilesTests : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
PreserveFilesTests();
|
||||||
|
~PreserveFilesTests() override {}
|
||||||
|
|
||||||
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
|
|
||||||
|
/*
|
||||||
|
void testOneUrl();
|
||||||
|
void testUrls_data();
|
||||||
|
void testUrls();
|
||||||
|
|
||||||
|
void testBadConfigDoesNotResetUrls();
|
||||||
|
*/
|
||||||
|
void testTrue();
|
||||||
|
};
|
||||||
|
|
||||||
|
PreserveFilesTests::PreserveFilesTests() {}
|
||||||
|
|
||||||
|
void
|
||||||
|
PreserveFilesTests::initTestCase()
|
||||||
|
{
|
||||||
|
Logger::setupLogLevel( Logger::LOGDEBUG );
|
||||||
|
cDebug() << "PreserveFiles test started.";
|
||||||
|
|
||||||
|
// Ensure we have a system object, expect it to be a "bogus" one
|
||||||
|
CalamaresUtils::System* system = CalamaresUtils::System::instance();
|
||||||
|
QVERIFY( system );
|
||||||
|
cDebug() << Logger::SubEntry << "System @" << Logger::Pointer( system );
|
||||||
|
|
||||||
|
const auto* settings = Calamares::Settings::instance();
|
||||||
|
if ( !settings )
|
||||||
|
{
|
||||||
|
(void)new Calamares::Settings( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PreserveFilesTests::testTrue()
|
||||||
|
{
|
||||||
|
QVERIFY( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QTEST_GUILESS_MAIN( PreserveFilesTests )
|
||||||
|
|
||||||
|
#include "utils/moc-warnings.h"
|
||||||
|
|
||||||
|
#include "Tests.moc"
|
Loading…
Reference in New Issue
Block a user