mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-26 00:15:16 +00:00
29 lines
639 B
C++
29 lines
639 B
C++
#pragma once
|
|
|
|
#include <QFile>
|
|
#include <QCoreApplication>
|
|
#include <QTest>
|
|
#include <QDir>
|
|
|
|
#define expandstr(s) expandstr2(s)
|
|
#define expandstr2(s) #s
|
|
|
|
class TestsInternal
|
|
{
|
|
public:
|
|
static QByteArray readFile(const QString &fileName)
|
|
{
|
|
QFile f(fileName);
|
|
f.open(QFile::ReadOnly);
|
|
return f.readAll();
|
|
}
|
|
static QString readFileUtf8(const QString &fileName)
|
|
{
|
|
return QString::fromUtf8(readFile(fileName));
|
|
}
|
|
};
|
|
|
|
#define MULTIMC_GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file))
|
|
#define MULTIMC_GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file))
|
|
|