diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-06-08 12:12:15 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-06-08 12:12:15 +0200 |
| commit | f50ec041a0f6fa036305ab5d5bdbdb9116b48024 (patch) | |
| tree | a11bc0c12113b03c8d1d88873980d680cb7bfd19 /gui/tests/gtk-test.cpp | |
| parent | 8f7d79ed8433bd4809ecef12e6c8c9c015cd903b (diff) | |
| download | turns-f50ec041a0f6fa036305ab5d5bdbdb9116b48024.tar.xz turns-f50ec041a0f6fa036305ab5d5bdbdb9116b48024.zip | |
gui: add more ParticipantEditor editing tests
Diffstat (limited to 'gui/tests/gtk-test.cpp')
| -rw-r--r-- | gui/tests/gtk-test.cpp | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/gui/tests/gtk-test.cpp b/gui/tests/gtk-test.cpp index 8f897d9..385f772 100644 --- a/gui/tests/gtk-test.cpp +++ b/gui/tests/gtk-test.cpp @@ -3,49 +3,37 @@ * SPDX-License-Identifier: LGPL-2.1-only */ -#include "turnsmm/init.hpp" +#include "gtk-test.hpp" -#include <catch2/internal/catch_test_run_info.hpp> -#include <catch2/reporters/catch_reporter_event_listener.hpp> -#include <catch2/reporters/catch_reporter_registrars.hpp> - -#include <adwaitamm/application.hpp> -#include <adwaitamm/wrap_init.hpp> -#include <glibmm/i18n.h> -#include <glibmm/refptr.h> -#include <gtkmm/init.h> +#include <turnsmm/init.hpp> #include <libintl.h> #include <clocale> -namespace turns::ui::tests +namespace Turns::gui::tests { - struct gtk_test : Catch::EventListenerBase + auto gtk_test::testRunStarting(Catch::TestRunInfo const &) -> void { - using Catch::EventListenerBase::EventListenerBase; - - auto testRunStarting(Catch::TestRunInfo const &) -> void override - { - setlocale(LC_ALL, ""); - bindtextdomain("turns", TESTLOCALEDIR); - bind_textdomain_codeset("turns", "UTF-8"); - textdomain("turns"); - - m_app = Adwaita::Application::create("ch.arknet.turns.tests.ui"); - Turns::init(); - } + setlocale(LC_ALL, ""); + bindtextdomain("turns", TESTLOCALEDIR); + bind_textdomain_codeset("turns", "UTF-8"); + textdomain("turns"); - auto testCaseEnded(Catch::TestCaseStats const &) -> void override - { - setlocale(LC_ALL, ""); - } + application = Adwaita::Application::create("ch.arknet.turns.tests.ui"); + Turns::init(); + } - private: - Glib::RefPtr<Adwaita::Application> m_app{}; - }; + auto gtk_test::testRunEnded(Catch::TestRunStats const &) -> void + { + application->quit(); + application.reset(); + } - CATCH_REGISTER_LISTENER(gtk_test); + auto gtk_test::testCaseEnded(Catch::TestCaseStats const &) -> void + { + setlocale(LC_ALL, ""); + } -} // namespace turns::ui::tests
\ No newline at end of file +} // namespace Turns::Gui::tests
\ No newline at end of file |
