X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=tst%2Fintegration%2FClientTest.cpp;fp=tst%2Fintegration%2FClientTest.cpp;h=93a17d4223e485324e8a217758cb1d4944a6a3f1;hb=aee07b0f8d8c0d9af66dd7507938d83985d53833;hp=0000000000000000000000000000000000000000;hpb=e927325f8b92c0d03c87fed77118f8e55df1b0c9;p=blank.git diff --git a/tst/integration/ClientTest.cpp b/tst/integration/ClientTest.cpp new file mode 100644 index 0000000..93a17d4 --- /dev/null +++ b/tst/integration/ClientTest.cpp @@ -0,0 +1,51 @@ +#include "ClientTest.hpp" + +#include "TestInstance.hpp" + +#include + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(blank::test::ClientTest, "headed"); + + +namespace blank { +namespace test { + +void ClientTest::setUp() { + server.reset(new TestInstance({ "--server" }, true)); + server->AssertRunning(); + server->AssertOutputLine("loading spawn chunks"); + server->AssertOutputLine("listening on UDP port 12354"); + client.reset(new TestInstance({ "--client" })); + client->AssertRunning(); + client->AssertOutputLine("got message before interface was created: player \"default\" joined"); + client->AssertOutputLine("joined game \"default\""); + server->AssertOutputLine("player \"default\" joined"); + server->AssertOutputLine("accepted login from player \"default\""); +} + +void ClientTest::tearDown() { + std::unique_ptr srv(std::move(server)); + std::unique_ptr cln(std::move(client)); + if (cln) { + cln->Terminate(); + cln->AssertNoOutput(); + cln->AssertNoError(); + cln->AssertExitStatus(0); + } + if (srv) { + srv->Terminate(); + srv->AssertOutputLine("player \"default\" left"); + srv->AssertOutputLine("saving remaining chunks"); + srv->AssertNoOutput(); + srv->AssertNoError(); + srv->AssertExitStatus(0); + } +} + + +void ClientTest::testStartup() { + +} + +} +}