aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-platform/TestPlatform.cpp
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2014-01-10 18:46:10 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:18 +0100
commita472fec381e7abc3d9e1384d1b7581a9e304a16c (patch)
tree4459838fa576d69e41d792a828fb73731cd128cf /test/test-platform/TestPlatform.cpp
parent6c55e9a1829f613f37df4e5fd0dbdde006a76707 (diff)
downloadexternal_parameter-framework-a472fec381e7abc3d9e1384d1b7581a9e304a16c.zip
external_parameter-framework-a472fec381e7abc3d9e1384d1b7581a9e304a16c.tar.gz
external_parameter-framework-a472fec381e7abc3d9e1384d1b7581a9e304a16c.tar.bz2
Allow starting test-platform as a Daemon
BZ: 151780 Currently, test-platform does not return when it is launched. In particular, one has to try to connect to it in order to know if it has correctly been initialized. Added a new '-d' option to test-platform to start it as a daemon: test-platform [-d] <file path> [port number, default 5001] When test-platform is started as a daemon, a child process is created and the main process immediatly returns its status. Change-Id: I70a33691909c958904cf50d156a563b998f92657 Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Diffstat (limited to 'test/test-platform/TestPlatform.cpp')
-rw-r--r--test/test-platform/TestPlatform.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test-platform/TestPlatform.cpp b/test/test-platform/TestPlatform.cpp
index b69a10e..1b9951e 100644
--- a/test/test-platform/TestPlatform.cpp
+++ b/test/test-platform/TestPlatform.cpp
@@ -29,6 +29,7 @@
#include <assert.h>
#include <errno.h>
#include <convert.hpp>
+#include <sstream>
#include "TestPlatform.h"
#include "ParameterMgrPlatformConnector.h"
#include "RemoteProcessorServer.h"
@@ -53,6 +54,7 @@ public:
CTestPlatform::CTestPlatform(const string& strClass, int iPortNumber, sem_t& exitSemaphore) :
_pParameterMgrPlatformConnector(new CParameterMgrPlatformConnector(strClass)),
_pParameterMgrPlatformConnectorLogger(new CParameterMgrPlatformConnectorLogger),
+ _portNumber(iPortNumber),
_exitSemaphore(exitSemaphore)
{
_pCommandHandler = new CCommandHandler(this);
@@ -146,7 +148,9 @@ bool CTestPlatform::load(std::string& strError)
// Start remote processor server
if (!_pRemoteProcessorServer->start()) {
- strError = "Unable to start remote processor server";
+ ostringstream oss;
+ oss << "TestPlatform: Unable to start remote processor server on port " << _portNumber;
+ strError = oss.str();
return false;
}