#include "io/LineBuffer.hpp"
#include "net/tcp.hpp"
+#include <list>
+#include <string>
+
namespace blank {
namespace test {
/// 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:
/// 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);
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;
};