From: Daniel Karbach Date: Mon, 21 Nov 2016 16:46:04 +0000 (+0100) Subject: test standalone app launch X-Git-Url: http://git.localhorst.tv/?p=blank.git;a=commitdiff_plain;h=3ff7bfeecf8ddc8d5b384683246a39bc05f9794d test standalone app launch --- diff --git a/src/standalone/standalone.cpp b/src/standalone/standalone.cpp index 4c502ba..b556918 100644 --- a/src/standalone/standalone.cpp +++ b/src/standalone/standalone.cpp @@ -12,6 +12,7 @@ #include "../world/ChunkRenderer.hpp" #include +#include 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 index 0000000..2e1b67d --- /dev/null +++ b/tst/integration/StandaloneTest.cpp @@ -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 index 0000000..99c5ad9 --- /dev/null +++ b/tst/integration/StandaloneTest.hpp @@ -0,0 +1,30 @@ +#ifndef BLANK_TEST_INTEGRATION_STANDALONETEST_HPP_ +#define BLANK_TEST_INTEGRATION_STANDALONETEST_HPP_ + +#include + + +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