]> git.localhorst.tv Git - blank.git/commitdiff
test standalone app launch
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 21 Nov 2016 16:46:04 +0000 (17:46 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 21 Nov 2016 16:46:04 +0000 (17:46 +0100)
src/standalone/standalone.cpp
tst/integration/StandaloneTest.cpp [new file with mode: 0644]
tst/integration/StandaloneTest.hpp [new file with mode: 0644]

index 4c502ba5a9666edb182ebbe9000dea87ff81ec5d..b556918db34023cd645dd3c3fed9df45aab8a015 100644 (file)
@@ -12,6 +12,7 @@
 #include "../world/ChunkRenderer.hpp"
 
 #include <SDL.h>
+#include <iostream>
 
 
 namespace blank {
@@ -94,6 +95,7 @@ void MasterState::OnResume() {
                env.state.Push(&preload);
                return;
        }
+       std::cout << "chunk preloading complete" << std::endl;
        if (spawn_player) {
                // TODO: spawn
                spawn_player = false;
diff --git a/tst/integration/StandaloneTest.cpp b/tst/integration/StandaloneTest.cpp
new file mode 100644 (file)
index 0000000..2e1b67d
--- /dev/null
@@ -0,0 +1,31 @@
+#include "StandaloneTest.hpp"
+
+#include "TestInstance.hpp"
+
+CPPUNIT_TEST_SUITE_REGISTRATION(blank::test::StandaloneTest);
+
+
+namespace blank {
+namespace test {
+
+void StandaloneTest::setUp() {
+
+}
+
+void StandaloneTest::tearDown() {
+
+}
+
+
+void StandaloneTest::testStartup() {
+       TestInstance standalone({ });
+       standalone.AssertRunning();
+       standalone.AssertOutputLine("chunk preloading complete");
+       standalone.Terminate();
+       standalone.AssertExitStatus(0);
+       // can't do that because AL blurts out nonsense
+       //standalone.AssertNoError();
+}
+
+}
+}
diff --git a/tst/integration/StandaloneTest.hpp b/tst/integration/StandaloneTest.hpp
new file mode 100644 (file)
index 0000000..99c5ad9
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef BLANK_TEST_INTEGRATION_STANDALONETEST_HPP_
+#define BLANK_TEST_INTEGRATION_STANDALONETEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+namespace blank {
+namespace test {
+
+class StandaloneTest
+: public CppUnit::TestFixture {
+
+CPPUNIT_TEST_SUITE(StandaloneTest);
+
+CPPUNIT_TEST(testStartup);
+
+CPPUNIT_TEST_SUITE_END();
+
+public:
+       void setUp();
+       void tearDown();
+
+       void testStartup();
+
+};
+
+}
+}
+
+#endif