2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2013-09-27 15:58:50 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-09-27 15:58:50 +02:00
|
|
|
|
|
|
|
|
#include "core_global.h"
|
|
|
|
|
|
2013-10-01 10:22:37 +02:00
|
|
|
#include <QString>
|
2013-09-27 15:58:50 +02:00
|
|
|
|
2013-12-16 16:02:45 +01:00
|
|
|
#define QTC_DECLARE_MYTESTDATADIR(PATH) \
|
2013-12-19 01:30:49 +01:00
|
|
|
class MyTestDataDir : public Core::Tests::TestDataDir \
|
2013-12-16 16:02:45 +01:00
|
|
|
{ \
|
|
|
|
|
public: \
|
|
|
|
|
MyTestDataDir(const QString &testDataDirectory = QString()) \
|
|
|
|
|
: TestDataDir(QLatin1String(SRCDIR "/" PATH) + testDataDirectory) {} \
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-27 15:58:50 +02:00
|
|
|
namespace Core {
|
|
|
|
|
namespace Tests {
|
|
|
|
|
|
2013-10-01 10:22:37 +02:00
|
|
|
class CORE_EXPORT TestDataDir
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TestDataDir(const QString &directory);
|
2014-12-09 17:09:45 +01:00
|
|
|
|
2013-10-01 10:22:37 +02:00
|
|
|
QString file(const QString &fileName) const;
|
|
|
|
|
QString directory(const QString &subdir = QString(), bool clean = true) const;
|
|
|
|
|
|
2014-12-09 17:09:45 +01:00
|
|
|
QString path() const;
|
|
|
|
|
|
2013-10-01 10:22:37 +02:00
|
|
|
private:
|
|
|
|
|
QString m_directory;
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-27 15:58:50 +02:00
|
|
|
} // namespace Tests
|
|
|
|
|
} // namespace Core
|