Only add helpers for mocked SyncthingConnection if required
This commit is contained in:
parent
c690af9679
commit
fe0688cb27
|
@ -23,8 +23,6 @@ set(SRC_FILES
|
||||||
syncthingdir.cpp
|
syncthingdir.cpp
|
||||||
syncthingdev.cpp
|
syncthingdev.cpp
|
||||||
syncthingconnection.cpp
|
syncthingconnection.cpp
|
||||||
syncthingconnectionmockhelpers.h
|
|
||||||
syncthingconnectionmockhelpers.cpp
|
|
||||||
syncthingconnectionsettings.cpp
|
syncthingconnectionsettings.cpp
|
||||||
syncthingconfig.cpp
|
syncthingconfig.cpp
|
||||||
syncthingprocess.cpp
|
syncthingprocess.cpp
|
||||||
|
@ -89,6 +87,10 @@ endif()
|
||||||
# configure whether the connection should be mocked for test purposes
|
# 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)
|
option(SYNCTHING_CONNECTION_MOCKED "enables mocking the SyncthingConnection class so it will provide only some fixed test data" OFF)
|
||||||
if(SYNCTHING_CONNECTION_MOCKED)
|
if(SYNCTHING_CONNECTION_MOCKED)
|
||||||
|
list(APPEND SRC_FILES
|
||||||
|
syncthingconnectionmockhelpers.h
|
||||||
|
syncthingconnectionmockhelpers.cpp
|
||||||
|
)
|
||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
syncthingconnection.cpp
|
syncthingconnection.cpp
|
||||||
syncthingconnectionmockhelpers.h
|
syncthingconnectionmockhelpers.h
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#include "./syncthingconnection.h"
|
#include "./syncthingconnection.h"
|
||||||
#include "./syncthingconfig.h"
|
#include "./syncthingconfig.h"
|
||||||
#include "./syncthingconnectionmockhelpers.h"
|
|
||||||
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
|
|
||||||
#include "./syncthingconnectionsettings.h"
|
#include "./syncthingconnectionsettings.h"
|
||||||
#endif
|
|
||||||
#include "./utils.h"
|
#include "./utils.h"
|
||||||
|
|
||||||
|
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
|
||||||
|
#include "./syncthingconnectionmockhelpers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <c++utilities/conversion/conversionexception.h>
|
#include <c++utilities/conversion/conversionexception.h>
|
||||||
#include <c++utilities/conversion/stringconversion.h>
|
#include <c++utilities/conversion/stringconversion.h>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#ifdef LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
|
|
||||||
|
|
||||||
#include "./syncthingconnectionmockhelpers.h"
|
#include "./syncthingconnectionmockhelpers.h"
|
||||||
|
|
||||||
#include <c++utilities/conversion/stringbuilder.h>
|
#include <c++utilities/conversion/stringbuilder.h>
|
||||||
|
@ -193,5 +191,3 @@ void MockedReply::emitFinished()
|
||||||
emit finished();
|
emit finished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LIB_SYNCTHING_CONNECTOR_CONNECTION_MOCKED
|
|
||||||
|
|
Loading…
Reference in New Issue