Commit ffb80cb0 authored by Elvis Angelaccio's avatar Elvis Angelaccio
Browse files

Enable test mode in all test

parent c1cd4fdc
Pipeline #53984 passed with stage
in 7 minutes and 15 seconds
......@@ -11,6 +11,7 @@
#include <QJsonDocument>
#include <QJsonObject>
#include <QStringList>
#include <QStandardPaths>
#include <QUrl>
#include <QUrlQuery>
......@@ -19,6 +20,7 @@ class DolphinSearchBoxTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void testBalooSearchParsing_data();
void testBalooSearchParsing();
};
......@@ -45,6 +47,11 @@ QUrl balooQueryUrl(const QString& searchString)
return searchUrl;
}
void DolphinSearchBoxTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
/**
* Defines the parameters for the test cases in testBalooSearchParsing()
*/
......
......@@ -6,6 +6,7 @@
#include "search/dolphinsearchbox.h"
#include <QStandardPaths>
#include <QTest>
class DolphinSearchBoxTest : public QObject
......@@ -13,6 +14,7 @@ class DolphinSearchBoxTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
......@@ -22,6 +24,11 @@ private:
DolphinSearchBox* m_searchBox;
};
void DolphinSearchBoxTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void DolphinSearchBoxTest::init()
{
m_searchBox = new DolphinSearchBox();
......
......@@ -4,6 +4,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <QStandardPaths>
#include <QTest>
#include <views/draganddrophelper.h>
......@@ -12,10 +13,16 @@ class DragAndDropHelperTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void testUrlListMatchesUrl_data();
void testUrlListMatchesUrl();
};
void DragAndDropHelperTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void DragAndDropHelperTest::testUrlListMatchesUrl_data()
{
QTest::addColumn<QList<QUrl>>("urlList");
......
......@@ -12,12 +12,14 @@
#include <QGraphicsView>
#include <QTest>
#include <QSignalSpy>
#include <QStandardPaths>
class KFileItemListViewTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
void testGroupedItemChanges();
......@@ -29,6 +31,11 @@ private:
QGraphicsView* m_graphicsView;
};
void KFileItemListViewTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KFileItemListViewTest::init()
{
qRegisterMetaType<KItemRangeList>("KItemRangeList");
......
......@@ -7,6 +7,7 @@
#include <QTest>
#include <QSignalSpy>
#include <QStandardPaths>
#include <random>
......@@ -44,6 +45,7 @@ public:
KFileItemModelBenchmark();
private Q_SLOTS:
void initTestCase();
void insertAndRemoveManyItems_data();
void insertAndRemoveManyItems();
......@@ -55,6 +57,11 @@ KFileItemModelBenchmark::KFileItemModelBenchmark()
{
}
void KFileItemModelBenchmark::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
{
QTest::addColumn<KFileItemList>("initialItems");
......
......@@ -8,6 +8,7 @@
#include <QRandomGenerator>
#include <QTest>
#include <QSignalSpy>
#include <QStandardPaths>
#include <QTimer>
#include <QMimeData>
......@@ -47,6 +48,7 @@ class KFileItemModelTest : public QObject
private Q_SLOTS:
void init();
void initTestCase();
void cleanup();
void testDefaultRoles();
......@@ -93,6 +95,11 @@ private:
TestDir* m_testDir;
};
void KFileItemModelTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KFileItemModelTest::init()
{
// The item-model tests result in a huge number of debugging
......
......@@ -16,6 +16,7 @@
#include <QGraphicsSceneMouseEvent>
#include <QSignalSpy>
#include <QProxyStyle>
#include <QStandardPaths>
/**
* \class KItemListControllerTestStyle is a proxy style for testing the
......@@ -103,6 +104,7 @@ private:
*/
void KItemListControllerTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
qRegisterMetaType<KItemSet>("KItemSet");
m_testDir = new TestDir();
......
......@@ -8,12 +8,14 @@
#include <QTest>
#include <QSignalSpy>
#include <QStandardPaths>
class KItemListKeyboardSearchManagerTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void testBasicKeyboardSearch();
......@@ -25,6 +27,11 @@ private:
KItemListKeyboardSearchManager m_keyboardSearchManager;
};
void KItemListKeyboardSearchManagerTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KItemListKeyboardSearchManagerTest::init()
{
// Make sure that the previous search string is cleared
......
......@@ -10,6 +10,7 @@
#include <QTest>
#include <QSignalSpy>
#include <QStandardPaths>
class DummyModel : public KItemModelBase
{
......@@ -52,6 +53,7 @@ class KItemListSelectionManagerTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
......@@ -76,6 +78,11 @@ private:
DummyModel* m_model;
};
void KItemListSelectionManagerTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KItemListSelectionManagerTest::init()
{
m_model = new DummyModel();
......
......@@ -6,6 +6,7 @@
#include "kitemviews/kitemrange.h"
#include <QStandardPaths>
#include <QTest>
Q_DECLARE_METATYPE(QVector<int>)
......@@ -16,10 +17,16 @@ class KItemRangeTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void testFromSortedContainer_data();
void testFromSortedContainer();
};
void KItemRangeTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KItemRangeTest::testFromSortedContainer_data()
{
QTest::addColumn<QVector<int> >("sortedNumbers");
......
......@@ -6,6 +6,7 @@
#include "kitemviews/kitemset.h"
#include <QStandardPaths>
#include <QTest>
Q_DECLARE_METATYPE(KItemRangeList)
......@@ -110,6 +111,8 @@ private:
void KItemSetTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
m_testCases.insert("empty", KItemRangeList());
m_testCases.insert("[0]", KItemRangeList() << KItemRange(0, 1));
m_testCases.insert("[1]", KItemRangeList() << KItemRange(1, 1));
......
......@@ -10,6 +10,7 @@
#include "kitemviews/kstandarditem.h"
#include "kitemviews/kstandarditemmodel.h"
#include <QStandardPaths>
#include <QTest>
class KStandardItemModelTest : public QObject
......@@ -17,6 +18,7 @@ class KStandardItemModelTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
......@@ -30,6 +32,11 @@ private:
KStandardItemModel* m_model;
};
void KStandardItemModelTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void KStandardItemModelTest::init()
{
m_model = new KStandardItemModel();
......
......@@ -15,6 +15,7 @@ class ViewPropertiesTest : public QObject
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void init();
void cleanup();
......@@ -26,6 +27,11 @@ private:
TestDir* m_testDir;
};
void ViewPropertiesTest::initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
}
void ViewPropertiesTest::init()
{
m_globalViewProps = GeneralSettings::self()->globalViewProps();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment