summaryrefslogtreecommitdiff
path: root/gui/tests/gtk-test.hpp
blob: 5ac67535b0864c7118a7ba8944a11ec705600dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com>
 * SPDX-License-Identifier: LGPL-2.1-only
 */

#ifndef TURNS_GUI_TESTS_GTK_TEST_HPP
#define TURNS_GUI_TESTS_GTK_TEST_HPP

#include <catch2/reporters/catch_reporter_event_listener.hpp>
#include <catch2/reporters/catch_reporter_registrars.hpp>

#include <adwaitamm/application.hpp>
#include <glibmm/refptr.h>

namespace Turns::gui::tests
{

  struct gtk_test : Catch::EventListenerBase
  {
    using Catch::EventListenerBase::EventListenerBase;

    static inline Glib::RefPtr<Adwaita::Application> application{};

    auto testRunStarting(Catch::TestRunInfo const &) -> void override;
    auto testRunEnded(Catch::TestRunStats const &) -> void override;
    auto testCaseEnded(Catch::TestCaseStats const &) -> void override;
  };

  CATCH_REGISTER_LISTENER(gtk_test);

}  // namespace turns::ui::tests

#endif