diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 00:25:19 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-07 00:25:19 +0100 |
commit | b43ed0554f5d6326f80e8d6bd85d75a422ca8c05 (patch) | |
tree | 596e967d69b073109dad7db437a60093bf499e26 /test | |
parent | Replace deprecated GL_QUADS usage in text rendering (diff) | |
parent | Replace deprecated GL_QUADS usage in text rendering (diff) | |
download | ilt-b43ed0554f5d6326f80e8d6bd85d75a422ca8c05.tar.bz2 ilt-b43ed0554f5d6326f80e8d6bd85d75a422ca8c05.tar.xz ilt-b43ed0554f5d6326f80e8d6bd85d75a422ca8c05.zip |
Merge branch 'imgui'
Diffstat (limited to 'test')
-rw-r--r-- | test/Jamfile.jam | 8 | ||||
-rw-r--r-- | test/perf-assetFactory.cpp | 6 | ||||
-rw-r--r-- | test/perf-instancing.cpp | 2 | ||||
-rw-r--r-- | test/test-assetFactory.cpp | 4 | ||||
-rw-r--r-- | test/test-glContainer.cpp | 4 | ||||
-rw-r--r-- | test/test-instancing.cpp | 6 | ||||
-rw-r--r-- | test/test-network.cpp | 4 | ||||
-rw-r--r-- | test/test-render.cpp | 3 | ||||
-rw-r--r-- | test/test-text.cpp | 4 | ||||
-rw-r--r-- | test/testMainWindow.cpp | 2 | ||||
-rw-r--r-- | test/testMainWindow.h | 12 |
11 files changed, 20 insertions, 35 deletions
diff --git a/test/Jamfile.jam b/test/Jamfile.jam index 1266854..0b830a8 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -55,8 +55,8 @@ run test-enumDetails.cpp ; run test-render.cpp : -- : test-assetFactory : <library>test ; run test-glContextBhvr.cpp ; run test-assetFactory.cpp : -- : [ sequence.insertion-sort [ glob-tree $(res) : *.* ] fixtures/rgb.txt test-instancing ] : <library>test ; -run perf-assetFactory.cpp : <\ : test-assetFactory : <library>benchmark <library>test ; -run perf-geoData.cpp : : : <library>test <library>benchmark ; +run perf-assetFactory.cpp : \< : test-assetFactory : <library>benchmark <library>test ; +run perf-geoData.cpp : \< : test-geoData : <library>test <library>benchmark ; run perf-persistence.cpp : \< : test-persistence : <library>benchmark <library>test ; run test-worker.cpp ; run test-instancing.cpp : -- : test-glContainer : <library>test ; @@ -67,7 +67,7 @@ compile test-static-enumDetails.cpp ; compile test-static-stream_support.cpp ; explicit perf-assetFactory ; explicit perf-persistence ; -explicit perf-terrain ; +explicit perf-geoData ; explicit perf-instancing ; -alias perf : perf-assetFactory perf-persistence perf-terrain ; +alias perf : perf-assetFactory perf-persistence perf-geoData perf-instancing ; explicit perf ; diff --git a/test/perf-assetFactory.cpp b/test/perf-assetFactory.cpp index 147e4ba..671713c 100644 --- a/test/perf-assetFactory.cpp +++ b/test/perf-assetFactory.cpp @@ -1,13 +1,11 @@ #include "assetFactory/assetFactory.h" -#include "assetFactory/factoryMesh.h" #include "testMainWindow.h" -#include "ui/applicationBase.h" #include <benchmark/benchmark.h> static void brush47xml_load(benchmark::State & state) { - TestMainWindow window; + TestMainWindowAppBase window; for (auto _ : state) { benchmark::DoNotOptimize(AssetFactory::loadXML(RESDIR "/brush47.xml")); @@ -17,7 +15,7 @@ brush47xml_load(benchmark::State & state) static void foliagexml_load(benchmark::State & state) { - TestMainWindow window; + TestMainWindowAppBase window; for (auto _ : state) { benchmark::DoNotOptimize(AssetFactory::loadXML(RESDIR "/foliage.xml")); diff --git a/test/perf-instancing.cpp b/test/perf-instancing.cpp index 829ea50..3638111 100644 --- a/test/perf-instancing.cpp +++ b/test/perf-instancing.cpp @@ -26,7 +26,7 @@ struct data { static void partition(benchmark::State & state) { - TestMainWindow window; + TestMainWindowAppBase window; data d(static_cast<size_t>(state.range())); GlobalPosition2D pos {}; for (auto _ : state) { diff --git a/test/test-assetFactory.cpp b/test/test-assetFactory.cpp index 73370c8..1c2c417 100644 --- a/test/test-assetFactory.cpp +++ b/test/test-assetFactory.cpp @@ -21,10 +21,8 @@ #include "lib/location.h" #include "lib/stream_support.h" #include "testMainWindow.h" -#include "ui/applicationBase.h" -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); const std::filesystem::path TMP {"/tmp"}; diff --git a/test/test-glContainer.cpp b/test/test-glContainer.cpp index ec1c0d1..332d440 100644 --- a/test/test-glContainer.cpp +++ b/test/test-glContainer.cpp @@ -1,7 +1,6 @@ #define BOOST_TEST_MODULE glContainer #include "testMainWindow.h" -#include "ui/applicationBase.h" #include <boost/test/data/test_case.hpp> #include <boost/test/unit_test.hpp> @@ -15,8 +14,7 @@ BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::const_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::reverse_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer<int>::const_reverse_iterator); -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_FIXTURE_TEST_SUITE(i, glContainer<int>) diff --git a/test/test-instancing.cpp b/test/test-instancing.cpp index 77467d8..1dd4cea 100644 --- a/test/test-instancing.cpp +++ b/test/test-instancing.cpp @@ -1,17 +1,15 @@ #define BOOST_TEST_MODULE instancing -#include "stream_support.h" +#include "stream_support.h" // IWYU pragma: keep #include "testHelpers.h" #include "testMainWindow.h" -#include "ui/applicationBase.h" #include <boost/test/data/test_case.hpp> #include <boost/test/unit_test.hpp> #include <set> #include <gfx/gl/instanceVertices.h> -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); struct TestInstanceVertices : public InstanceVertices<int> { void diff --git a/test/test-network.cpp b/test/test-network.cpp index 174e2a5..59eebae 100644 --- a/test/test-network.cpp +++ b/test/test-network.cpp @@ -5,7 +5,6 @@ #include <boost/test/unit_test.hpp> #include "testMainWindow.h" -#include "ui/applicationBase.h" #include <array> #include <collection.h> #include <game/network/link.h> @@ -20,8 +19,7 @@ #include <utility> #include <vector> -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); struct TestLinkS; diff --git a/test/test-render.cpp b/test/test-render.cpp index 79424f5..2c4efea 100644 --- a/test/test-render.cpp +++ b/test/test-render.cpp @@ -69,8 +69,7 @@ public: } }; -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_DATA_TEST_CASE(cam, boost::unit_test::data::xrange(500, 30000, 1300) * boost::unit_test::data::xrange(500, 10000, 300) diff --git a/test/test-text.cpp b/test/test-text.cpp index f185cf5..b0a9503 100644 --- a/test/test-text.cpp +++ b/test/test-text.cpp @@ -7,7 +7,6 @@ #include "testMainWindow.h" #include "testRenderOutput.h" -#include "ui/applicationBase.h" #include "ui/text.h" #include <array> #include <gfx/models/texture.h> @@ -16,8 +15,7 @@ #include <unicode.h> #include <vector> -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_AUTO_TEST_CASE(utf8_string_view_iter) { diff --git a/test/testMainWindow.cpp b/test/testMainWindow.cpp index d0b674c..4a76044 100644 --- a/test/testMainWindow.cpp +++ b/test/testMainWindow.cpp @@ -2,7 +2,7 @@ #include <boost/test/test_tools.hpp> #include <format> -TestMainWindow::TestMainWindow() : Window {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN} +TestMainWindow::TestMainWindow() : MainWindow {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN} { glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback( diff --git a/test/testMainWindow.h b/test/testMainWindow.h index 445491d..f54eb72 100644 --- a/test/testMainWindow.h +++ b/test/testMainWindow.h @@ -1,15 +1,13 @@ #pragma once -#include "ui/window.h" +#include "ui/applicationBase.h" +#include "ui/mainWindow.h" -class TestMainWindow : public Window { +class TestMainWindow : public MainWindow { // This exists only to hold an OpenGL context open for the duration of the tests, // in the same way a real main window would always exist. public: TestMainWindow(); - - void - tick(TickDuration) override - { - } }; + +class TestMainWindowAppBase : public ApplicationBase, public TestMainWindow { }; |