From 02c3f1fd622bb5b4da1462c5bb507a4a541447d5 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 15 Jun 2024 15:28:53 +0100 Subject: First cut reshuffling app/window/gl/render bits --- test/test-assetFactory.cpp | 4 +--- test/test-glContainer.cpp | 4 +--- test/test-instancing.cpp | 5 +---- test/test-network.cpp | 4 +--- test/test-render.cpp | 3 +-- test/test-text.cpp | 4 +--- test/testMainWindow.cpp | 2 +- test/testMainWindow.h | 12 +++++------- 8 files changed, 12 insertions(+), 26 deletions(-) (limited to 'test') 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 #include @@ -15,8 +14,7 @@ BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::const_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::reverse_iterator); BOOST_TEST_DONT_PRINT_LOG_VALUE(glContainer::const_reverse_iterator); -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_FIXTURE_TEST_SUITE(i, glContainer) diff --git a/test/test-instancing.cpp b/test/test-instancing.cpp index c1860a4..3244bad 100644 --- a/test/test-instancing.cpp +++ b/test/test-instancing.cpp @@ -1,17 +1,14 @@ #define BOOST_TEST_MODULE instancing #include "stream_support.h" -#include "testHelpers.h" #include "testMainWindow.h" -#include "ui/applicationBase.h" #include #include #include #include -BOOST_GLOBAL_FIXTURE(ApplicationBase); -BOOST_GLOBAL_FIXTURE(TestMainWindow); +BOOST_GLOBAL_FIXTURE(TestMainWindowAppBase); BOOST_FIXTURE_TEST_SUITE(i, InstanceVertices) 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 #include "testMainWindow.h" -#include "ui/applicationBase.h" #include #include #include @@ -20,8 +19,7 @@ #include #include -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 #include @@ -16,8 +15,7 @@ #include #include -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 #include -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 { }; -- cgit v1.2.3 From d90c4ba89a4ed63438ca1aa4f5911037472c717e Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 2 Jul 2024 19:33:59 +0100 Subject: Re-add testHelpers.h --- test/test-instancing.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test-instancing.cpp b/test/test-instancing.cpp index 40c2c4f..1dd4cea 100644 --- a/test/test-instancing.cpp +++ b/test/test-instancing.cpp @@ -1,6 +1,7 @@ #define BOOST_TEST_MODULE instancing -#include "stream_support.h" +#include "stream_support.h" // IWYU pragma: keep +#include "testHelpers.h" #include "testMainWindow.h" #include #include -- cgit v1.2.3 From 97fe4b6b2d6ada8066821594543bea38b564fb93 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 5 Jul 2024 02:06:55 +0100 Subject: Fix up perf tests in light of window management changes --- test/Jamfile.jam | 8 ++++---- test/perf-assetFactory.cpp | 6 ++---- test/perf-instancing.cpp | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'test') 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 : test ; run test-glContextBhvr.cpp ; run test-assetFactory.cpp : -- : [ sequence.insertion-sort [ glob-tree $(res) : *.* ] fixtures/rgb.txt test-instancing ] : test ; -run perf-assetFactory.cpp : <\ : test-assetFactory : benchmark test ; -run perf-geoData.cpp : : : test benchmark ; +run perf-assetFactory.cpp : \< : test-assetFactory : benchmark test ; +run perf-geoData.cpp : \< : test-geoData : test benchmark ; run perf-persistence.cpp : \< : test-persistence : benchmark test ; run test-worker.cpp ; run test-instancing.cpp : -- : test-glContainer : 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 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(state.range())); GlobalPosition2D pos {}; for (auto _ : state) { -- cgit v1.2.3