]> git.localhorst.tv Git - blank.git/blobdiff - tst/integration/TestInstance.hpp
test missing option arguments
[blank.git] / tst / integration / TestInstance.hpp
index 3bd23d4e8003ea5d5e339d965aaf71e4d4fbc228..01fb25d65fffa74902175a118688f1b77ce86191 100644 (file)
@@ -6,6 +6,9 @@
 #include "io/LineBuffer.hpp"
 #include "net/tcp.hpp"
 
+#include <list>
+#include <string>
+
 
 namespace blank {
 namespace test {
@@ -17,7 +20,7 @@ public:
        /// will be prepended by the constructor).
        /// If connect is true, a command service connection will be
        /// established during construction.
-       explicit TestInstance(const Process::Arguments &args, bool connect = false);
+       explicit TestInstance(const Process::Arguments &args, bool connect = false, bool temp_save = true);
        ~TestInstance();
 
 public:
@@ -26,22 +29,36 @@ public:
        /// sure to include a newline character.
        void WriteInput(const std::string &data);
 
-       /// read next line from programs stdout
+       /// read next line from program's stdout
        void ReadOutputLine(std::string &line);
        /// assert that the next line the program writes to stdout will
        /// be the given one (without a trailing newline character)
        void AssertOutputLine(const std::string &line);
        /// wait until program writes given line to stdout
        void WaitOutputLine(const std::string &line);
+       /// read from program's stdout until EOF
+       void ExhaustOutput(std::string &output);
+       /// assert that the program produces no more output
+       void AssertNoOutput();
 
-       /// read next line from programs stderr
+       /// read next line from program's stderr
        void ReadErrorLine(std::string &line);
        /// assert that the next line the program writes to stderr will
        /// be the given one (without a trailing newline character)
        void AssertErrorLine(const std::string &line);
        /// wait until program writes given line to stderr
        void WaitErrorLine(const std::string &line);
-
+       /// read from program's stdout until EOF
+       void ExhaustError(std::string &error);
+       /// assert that the program produces no more output on stderr
+       void AssertNoError();
+
+       /// send termination signal
+       void Terminate();
+       /// assert that the program has not exited
+       void AssertRunning();
+       /// assert that the program has exited
+       void AssertTerminated();
        /// make sure the process terminated with given status
        void AssertExitStatus(int expected);
 
@@ -67,6 +84,10 @@ private:
        LineBuffer<BUFSIZ> out_buf;
        LineBuffer<BUFSIZ> err_buf;
        LineBuffer<BUFSIZ> cmd_buf;
+       std::string name;
+       std::list<std::string> past_out;
+       std::list<std::string> past_err;
+       std::list<std::string> past_cmd;
 
 };