Fork variant for TestStep command
[anna.git] / example / diameter / launcher / testing / TestStep.hpp
index 4f7e6e8..d239f97 100644 (file)
@@ -231,8 +231,10 @@ class TestStepCmd : public TestStep {
   std::string a_errorMsg;
   //std::string a_output; // for POPEN
 
+  pid_t a_childPid;
+
   public:
-    TestStepCmd(TestCase *testCase) : TestStep(testCase), a_threadRunning(false), a_threadDeprecated(false), a_resultCode(-2)/*, a_output("")*/, a_errorMsg("") { a_type = Type::Cmd; }
+    TestStepCmd(TestCase *testCase) : TestStep(testCase), a_threadRunning(false), a_threadDeprecated(false), a_resultCode(-2)/*, a_output("")*/, a_errorMsg(""), a_childPid(-1) { a_type = Type::Cmd; }
 
     // setter & getters
     void setThreadRunning(bool running) throw() { a_threadRunning = running; }
@@ -243,6 +245,8 @@ class TestStepCmd : public TestStep {
     const std::string &getErrorMsg() const throw() { return a_errorMsg; }
     //void appendOutput(const std::string &output) throw() { a_output += output; }
     //const std::string &getOutput() const throw() { return a_output; }
+    void setChildPid(pid_t pid) throw() { a_childPid = pid; }
+    const pid_t &getChildPid() const throw() { return a_childPid; }
 
     void setScript(const std::string &script) throw() { a_script = script; }
     const std::string &getScript() const throw() { return a_script; }