]> git.localhorst.tv Git - blank.git/blobdiff - tst/integration/ServerTest.cpp
simple test for client
[blank.git] / tst / integration / ServerTest.cpp
index fbec21a70f7cd7d9fe96929c1f717129816f61ee..8f55914afc90374097ad55112c49b657266b7a3f 100644 (file)
@@ -1,6 +1,6 @@
 #include "ServerTest.hpp"
 
-#include "TestServer.hpp"
+#include "TestInstance.hpp"
 
 CPPUNIT_TEST_SUITE_REGISTRATION(blank::test::ServerTest);
 
@@ -9,16 +9,26 @@ namespace blank {
 namespace test {
 
 void ServerTest::setUp() {
-
+       instance.reset(new TestInstance({ "--server" }, true));
+       instance->AssertRunning();
+       instance->AssertOutputLine("loading spawn chunks");
+       instance->AssertOutputLine("listening on UDP port 12354");
 }
 
 void ServerTest::tearDown() {
-
+       std::unique_ptr<TestInstance> inst(std::move(instance));
+       if (inst) {
+               inst->Terminate();
+               inst->AssertOutputLine("saving remaining chunks");
+               inst->AssertNoOutput();
+               inst->AssertNoError();
+               inst->AssertExitStatus(0);
+       }
 }
 
 
 void ServerTest::testStartup() {
-       TestServer server;
+       // setUp and testDown do all the tests
 }
 
 }