NOISSUE remove dead unit tests and reorganize CMake code related to unit tests

This commit is contained in:
Petr Mrázek
2016-04-13 01:24:55 +02:00
parent ed3884fd38
commit e8ba5dafc6
15 changed files with 159 additions and 127 deletions

28
cmake/UnitTest/TestUtil.h Normal file
View File

@ -0,0 +1,28 @@
#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))