testing: use target-config@client-test-$CLIENT_TEST_SERVER for Client::Source
For testing sources instantiated via SyncSource.cpp (for example, EDS) and client-test-app.cpp (ActiveSync) append the name of the server set via the CLIENT_TEST_SERVER env variable to target-config@client-test, separated by a hyphen. This allows configuring testing differently for different servers. Was already done for CalDAV sources, inside WebDAVSourceRegister.cpp.
This commit is contained in:
parent
40bbb59028
commit
24efbe11db
|
@ -515,7 +515,13 @@ private:
|
|||
/** called internally in this class */
|
||||
TestingSyncSource *createNamedSource(const string &name, bool isSourceA) {
|
||||
string database = getDatabaseName(name);
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("target-config@client-test"));
|
||||
std::string config = "target-config@client-test";
|
||||
const char *server = getenv("CLIENT_TEST_SERVER");
|
||||
if (server) {
|
||||
config += "-";
|
||||
config += server;
|
||||
}
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig(config));
|
||||
SyncSourceNodes nodes = context->getSyncSourceNodes(name,
|
||||
string("_") + m_clientID +
|
||||
"_" + (isSourceA ? "A" : "B"));
|
||||
|
|
|
@ -372,7 +372,13 @@ SyncSource *SyncSource::createSource(const SyncSourceParams ¶ms, bool error,
|
|||
SyncSource *SyncSource::createTestingSource(const string &name, const string &type, bool error,
|
||||
const char *prefix)
|
||||
{
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig("target-config@client-test"));
|
||||
std::string config = "target-config@client-test";
|
||||
const char *server = getenv("CLIENT_TEST_SERVER");
|
||||
if (server) {
|
||||
config += "-";
|
||||
config += server;
|
||||
}
|
||||
boost::shared_ptr<SyncConfig> context(new SyncConfig(config));
|
||||
SyncSourceNodes nodes = context->getSyncSourceNodes(name);
|
||||
SyncSourceParams params(name, nodes, context);
|
||||
PersistentSyncSourceConfig sourceconfig(name, nodes);
|
||||
|
|
Loading…
Reference in New Issue