X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Ftesting%2FTestStep.hpp;h=d239f974180e290c5202072d33585c44eff2e76b;hb=a06169181968130467d2e54ac91676aecd14bcea;hp=9b69579b77bd2bbad1ca5766a802a594740b7719;hpb=e80e62a5cf9aacad1a9551c68c432147ef98cd29;p=anna.git diff --git a/example/diameter/launcher/testing/TestStep.hpp b/example/diameter/launcher/testing/TestStep.hpp index 9b69579..d239f97 100644 --- a/example/diameter/launcher/testing/TestStep.hpp +++ b/example/diameter/launcher/testing/TestStep.hpp @@ -51,6 +51,7 @@ class TestStep { int a_number; // step number used for xml (informational) anna::Millisecond a_beginTimestamp; // unix time anna::Millisecond a_endTimestamp; // unix time + bool a_executed; // used for interactive mode in order to not repeat a execution step if before completing, the user add interactive amount void setBeginTimestamp(const anna::Millisecond &t) throw() { a_beginTimestamp = t; } const anna::Millisecond &getBeginTimestamp() const throw() { return a_beginTimestamp; } @@ -63,7 +64,7 @@ class TestStep { struct Type { enum _v { Unconfigured, Timeout, Sendxml2e, Sendxml2c, Delay, Wait, Cmd }; }; static const char* asText(const Type::_v type) throw(); - TestStep(TestCase *testCase) : a_message(true), a_messageCodec(NULL) { initialize(testCase); } + TestStep(TestCase *testCase) : a_message(true), a_messageCodec(NULL), a_executed(false) { initialize(testCase); } virtual ~TestStep() {;} // setter & getters @@ -223,7 +224,6 @@ class TestStepWait : public TestStep { class TestStepCmd : public TestStep { std::string a_script; - std::string a_parameters; std::thread a_thread; bool a_threadRunning; bool a_threadDeprecated; @@ -231,14 +231,13 @@ 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; } - //bool getThreadRunning() const throw() { return a_threadRunning; } - //void setThreadDeprecated(bool deprecated) throw() { a_threadDeprecated = deprecated; } - //bool getThreadDeprecated() const throw() { return a_threadDeprecated; } void setResultCode(int rc) throw() { a_resultCode = rc; } int getResultCode() const throw() { return a_resultCode; } @@ -246,11 +245,11 @@ 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; } - void setParameters(const std::string ¶ms) throw() { a_parameters = params; } - const std::string &getParameters() const throw() { return a_parameters; } // virtuals bool do_execute() throw();