Commit d2a46a00 authored by Laurent Montel's avatar Laurent Montel 😁

Avoid redefinition variable

parent 77fcad8f
......@@ -9,7 +9,7 @@ macro(add_plasma_pimeventsplugin_test _source _additional)
add_executable(${_name} ${_test})
add_test(${_name} ${_name})
ecm_mark_as_test(plasma-pimeventsplugin-${_name})
add_definitions(-DQT_TESTCASE_BUILDDIR=\"${CMAKE_CURRENT_SOURCE_DIR}\")
add_definitions(-DPIMEVENT_DATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}\")
target_link_libraries(${_name} Qt5::Core
Qt5::Test
KF5::AkonadiCore
......
......@@ -44,7 +44,7 @@ TestDataParser::~TestDataParser()
QStringList TestDataParser::allTestData()
{
QDir testdir(QStringLiteral(QT_TESTCASE_BUILDDIR "/data"));
QDir testdir(QStringLiteral(PIMEVENT_DATADIR "/data"));
const auto data = testdir.entryInfoList({ QStringLiteral("*.json") }, QDir::Files);
QStringList testcases;
for (const auto &fi : data) {
......@@ -87,7 +87,7 @@ QDateTime TestDataParser::parseDateTime(const QJsonObject &dateTime)
void TestDataParser::parse()
{
QFile icalFile(QStringLiteral(QT_TESTCASE_BUILDDIR "/data/%1.ics").arg(mTestData));
QFile icalFile(QStringLiteral(PIMEVENT_DATADIR "/data/%1.ics").arg(mTestData));
QVERIFY(icalFile.exists());
QVERIFY(icalFile.open(QIODevice::ReadOnly));
......@@ -96,7 +96,7 @@ void TestDataParser::parse()
mIncidence = format.readIncidence(data);
QVERIFY(mIncidence);
QFile jsonFile(QStringLiteral(QT_TESTCASE_BUILDDIR "/data/%1.json").arg(mTestData));
QFile jsonFile(QStringLiteral(PIMEVENT_DATADIR "/data/%1.json").arg(mTestData));
QVERIFY(jsonFile.exists());
QVERIFY(jsonFile.open(QIODevice::ReadOnly));
......
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