client-test: enable it to use keyring by default (MB #10479)

With "syncevolution" using the D-Bus server and thus the keyring
by default, the client-test executable should better also use
the keyring. Otherwise setting the password via the command line
will render a test config unusable for client-test.

The patch turns out to be very easy: reusing the code in
CmdlineSyncClient via changing the inheritance of the sync engine used
by client-test-app.cpp plus adapting compile flags is enough.
This commit is contained in:
Patrick Ohly 2010-04-19 14:38:27 +02:00
parent 4d5a1ba273
commit f0e0c4c373
2 changed files with 6 additions and 5 deletions

View File

@ -197,6 +197,7 @@ endif
# link line.
client_test_SOURCES = \
client-test-app.cpp \
CmdlineSyncClient.cpp \
../test/ClientTest.cpp \
../test/ClientTest.h \
../test/client-test-main.cpp \
@ -240,8 +241,8 @@ TEST_FILES_PATCHED = $(wildcard testcases/*.tem)
CLIENT_LIB_TEST_FILES += $(TEST_FILES_GENERATED)
client_test_CPPFLAGS = -DHAVE_CONFIG_H -DENABLE_INTEGRATION_TESTS -DENABLE_UNIT_TESTS $(AM_CPPFLAGS)
client_test_CXXFLAGS = `cppunit-config --cflags` $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS)
client_test_LDFLAGS = `cppunit-config --libs` `nm syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-u /'` $(CORE_LD_FLAGS)
client_test_CXXFLAGS = `cppunit-config --cflags` $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS)
client_test_LDFLAGS = `cppunit-config --libs` `nm syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-u /'` $(CORE_LD_FLAGS) $(KEYRING_LIBS)
client_test_LDADD = $(CORE_LDADD) $(SYNTHESIS_ENGINE)
# These dependencies are intentionally a bit too broad:
# they ensure that all files are in place to *run* client-test.

View File

@ -35,7 +35,7 @@
# include <execinfo.h>
#endif
#include <syncevo/SyncContext.h>
#include "CmdlineSyncClient.h"
#include "EvolutionSyncSource.h"
#include <syncevo/util.h>
#include <syncevo/VolatileConfigNode.h>
@ -310,12 +310,12 @@ public:
server += "_";
server += m_clientID;
class ClientTest : public SyncContext {
class ClientTest : public CmdlineSyncClient {
public:
ClientTest(const string &server,
const string &logbase,
const SyncOptions &options) :
SyncContext(server, false),
CmdlineSyncClient(server, false, true),
m_logbase(logbase),
m_options(options),
m_started(false)