Only add helpers for mocked SyncthingConnection if required

This commit is contained in:
Martchus 2017-09-05 00:35:54 +02:00
parent c690af9679
commit fe0688cb27
3 changed files with 8 additions and 9 deletions

View File

@ -23,8 +23,6 @@ set(SRC_FILES
syncthingdir.cpp
syncthingdev.cpp
syncthingconnection.cpp
syncthingconnectionmockhelpers.h
syncthingconnectionmockhelpers.cpp
syncthingconnectionsettings.cpp
syncthingconfig.cpp
syncthingprocess.cpp
@ -89,6 +87,10 @@ endif()
# configure whether the connection should be mocked for test purposes
option(SYNCTHING_CONNECTION_MOCKED "enables mocking the SyncthingConnection class so it will provide only some fixed test data" OFF)
if(SYNCTHING_CONNECTION_MOCKED)
list(APPEND SRC_FILES
syncthingconnectionmockhelpers.h
syncthingconnectionmockhelpers.cpp
)
set_source_files_properties(
syncthingconnection.cpp
syncthingconnectionmockhelpers.h

View File

@ -1,11 +1,12 @@
#include "./syncthingconnection.h"
#include "./syncthingconfig.h"
#include "./syncthingconnectionmockhelpers.h"
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
#include "./syncthingconnectionsettings.h"
#endif
#include "./utils.h"
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
#include "./syncthingconnectionmockhelpers.h"
#endif
#include <c++utilities/conversion/conversionexception.h>
#include <c++utilities/conversion/stringconversion.h>

View File

@ -1,5 +1,3 @@
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
#include "./syncthingconnectionmockhelpers.h"
#include <c++utilities/conversion/stringbuilder.h>
@ -193,5 +191,3 @@ void MockedReply::emitFinished()
emit finished();
}
}
#endif // LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED