summaryrefslogtreecommitdiffstats
path: root/test/test-platform/TestPlatform.h
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2014-01-10 18:43:04 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:17 +0100
commit9e3882819ce9d1fcc99a3ea3efa549e87efa7e7a (patch)
treebaf04894dc5cc50766b69eb57166c941ee14a344 /test/test-platform/TestPlatform.h
parentcee2d6bf92a30111b643e1222dcb64f4d116f724 (diff)
downloadexternal_parameter-framework-9e3882819ce9d1fcc99a3ea3efa549e87efa7e7a.zip
external_parameter-framework-9e3882819ce9d1fcc99a3ea3efa549e87efa7e7a.tar.gz
external_parameter-framework-9e3882819ce9d1fcc99a3ea3efa549e87efa7e7a.tar.bz2
Add Exit command to test-platform
BZ: 151780 The only way to exit test-platform is to kill it. However during the build process, the hostDomainGenerator.sh script needs to start and exit test-platform, without knowing its PID. Allow exiting the test-plaform though a new 'exit' command. Change-Id: Ifb94ea1c2017a0b23e25b42a06e2ceeae69ace89 Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Diffstat (limited to 'test/test-platform/TestPlatform.h')
-rw-r--r--test/test-platform/TestPlatform.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test-platform/TestPlatform.h b/test/test-platform/TestPlatform.h
index e8b9823..8673e9d 100644
--- a/test/test-platform/TestPlatform.h
+++ b/test/test-platform/TestPlatform.h
@@ -28,6 +28,7 @@
#include "RemoteCommandHandlerTemplate.h"
#include <string>
#include <list>
+#include <semaphore.h>
using namespace std;
@@ -40,7 +41,7 @@ class CTestPlatform
typedef TRemoteCommandHandlerTemplate<CTestPlatform> CCommandHandler;
typedef CCommandHandler::CommandStatus CommandReturn;
public:
- CTestPlatform(const string &strclass, int iPortNumber);
+ CTestPlatform(const string &strclass, int iPortNumber, sem_t& exitSemaphore);
virtual ~CTestPlatform();
// Init
@@ -89,6 +90,14 @@ private:
CommandReturn applyConfigurations(
const IRemoteCommand& remoteCommand, string& strResult);
+ /** Callback to exit the test-platform.
+ *
+ * @param[in] remoteCommand is ignored
+ *
+ * @return EDone (never fails)
+ */
+ CommandReturn exit(const IRemoteCommand& remoteCommand, string& strResult);
+
/** The type of a CParameterMgrPlatformConnector boolean setter. */
typedef bool (CParameterMgrPlatformConnector::*setter_t)(bool, string&);
/** Template callback to create a _pParameterMgrPlatformConnector boolean setter callback.
@@ -112,7 +121,7 @@ private:
* Convert to boolean returned by the template parameter function converted to a
* string ("True", "False") and return it.
*
- * @tparam the boolean getter method.
+ * @param the boolean getter method.
* @param[in] remoteCommand is ignored
*
* @return EDone (never fails)
@@ -140,5 +149,8 @@ private:
// Remote Processor Server
CRemoteProcessorServer* _pRemoteProcessorServer;
+
+ // Semaphore used by calling thread to avoid exiting
+ sem_t& _exitSemaphore;
};