Commit f0b5bc58 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use CompareExportFile

parent 26819f91
add_definitions( -DPIMDATAEXPORTER_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
set( exportaddressbookjobinterfacetest_SRCS exportaddressbookjobinterfacetest.cpp ../resourceconvertertest.cpp )
set( exportaddressbookjobinterfacetest_SRCS exportaddressbookjobinterfacetest.cpp)
add_executable( exportaddressbookjobinterfacetest ${exportaddressbookjobinterfacetest_SRCS})
add_test(NAME exportaddressbookjobinterfacetest COMMAND exportaddressbookjobinterfacetest)
ecm_mark_as_test(exportaddressbookjobinterfacetest)
target_link_libraries(exportaddressbookjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore)
target_link_libraries(exportaddressbookjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore test_resourceconverter)
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -19,7 +19,8 @@
#include "exportaddressbookjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include "compareexportfile.h"
#include "resourceconvertertest.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
......@@ -66,7 +67,8 @@ void ExportAddressbookJobInterfaceTest::exportAddressBookConfigTest1()
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
const QString temporaryFile = QStringLiteral("/tmp/foo.zip");
const QString storeArchivePath(temporaryFile);
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
......@@ -80,6 +82,10 @@ void ExportAddressbookJobInterfaceTest::exportAddressBookConfigTest1()
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
CompareExportFile compareExportFile;
compareExportFile.setTempFilePath(temporaryFile);
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/test1/list.txt"));
compareExportFile.compareFiles();
}
......
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -19,7 +19,8 @@
#include "exportakregatorjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include "resourceconvertertest.h"
#include "compareexportfile.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
......@@ -49,7 +50,8 @@ void ExportAkregatorJobInterfaceTest::exportAkregatorConfigTest1()
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
const QString temporaryFile = QStringLiteral("/tmp/foo.zip");
const QString storeArchivePath(temporaryFile);
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
......@@ -63,6 +65,11 @@ void ExportAkregatorJobInterfaceTest::exportAkregatorConfigTest1()
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
CompareExportFile compareExportFile;
compareExportFile.setTempFilePath(temporaryFile);
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/test1/list.txt"));
compareExportFile.compareFiles();
}
......
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -19,7 +19,8 @@
#include "exportalarmjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include "compareexportfile.h"
#include "resourceconvertertest.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
......@@ -54,7 +55,8 @@ void ExportAlarmJobInterfaceTest::exportAlarmConfigTest1()
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
const QString temporaryFile = QStringLiteral("/tmp/foo.zip");
const QString storeArchivePath(temporaryFile);
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
......@@ -68,6 +70,11 @@ void ExportAlarmJobInterfaceTest::exportAlarmConfigTest1()
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
CompareExportFile compareExportFile;
compareExportFile.setTempFilePath(temporaryFile);
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/test1/list.txt"));
compareExportFile.compareFiles();
}
......
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -19,7 +19,8 @@
#include "exportcalendarsjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include "compareexportfile.h"
#include "resourceconvertertest.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
......@@ -54,7 +55,8 @@ void ExportCalendarsJobInterfaceTest::exportCalendarConfigTest1()
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
const QString temporaryFile = QStringLiteral("/tmp/foo.zip");
const QString storeArchivePath(temporaryFile);
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
......@@ -68,6 +70,11 @@ void ExportCalendarsJobInterfaceTest::exportCalendarConfigTest1()
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
CompareExportFile compareExportFile;
compareExportFile.setTempFilePath(temporaryFile);
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/test1/list.txt"));
compareExportFile.compareFiles();
}
configs/globalnotesettings
configs/knotesrc
information/VERSION_2
information/exportdatatype.xml
......@@ -19,7 +19,8 @@
#include "exportmailjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include "resourceconvertertest.h"
#include "compareexportfile.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
......@@ -77,7 +78,8 @@ void ExportMailJobInterfaceTest::exportMailConfigTest1()
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
const QString temporaryFile = QStringLiteral("/tmp/foo.zip");
const QString storeArchivePath(temporaryFile);
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
......@@ -91,4 +93,9 @@ void ExportMailJobInterfaceTest::exportMailConfigTest1()
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
CompareExportFile compareExportFile;
compareExportFile.setTempFilePath(temporaryFile);
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/test1/list.txt"));
compareExportFile.compareFiles();
}
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