File: Test.cpp

package info (click to toggle)
kaidan 0.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,376 kB
  • sloc: cpp: 30,143; xml: 1,623; sh: 522; python: 34; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-FileCopyrightText: 2025 Filipe Azevedo <pasnox@gmail.com>
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "Test.h"

// Qt
#include <QStandardPaths>
#include <QTest>

void Test::initTestCase()
{
    QStandardPaths::setTestModeEnabled(true);

    // Remove old test data.
    removeTestDataDirectory();
}

void Test::removeTestDataDirectory()
{
    const auto testDirectoryPath = QStandardPaths::writableLocation(QStandardPaths::StandardLocation::AppDataLocation);

    if (auto testDirectory = QDir(testDirectoryPath); testDirectory.exists()) {
        QVERIFY(testDirectory.removeRecursively());
    }
}

#include "moc_Test.cpp"