summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-06-05 17:52:18 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-06-05 17:52:18 +0200
commit94488c636867be69a0ef69d8f95f3e7bf524fe96 (patch)
treead61bb18a1690177f6a6286d2eee9842c6f2a4c7 /gui
parenta4ec0fd60e42b99debeee50a4fe95c79d759f707 (diff)
downloadturns-94488c636867be69a0ef69d8f95f3e7bf524fe96.tar.xz
turns-94488c636867be69a0ef69d8f95f3e7bf524fe96.zip
gui: reintroduce resource tests
Diffstat (limited to 'gui')
-rw-r--r--gui/CMakeLists.txt1
-rw-r--r--gui/tests/resources.cpp14
2 files changed, 12 insertions, 3 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index c306597..ead9d19 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -151,6 +151,7 @@ install(TARGETS "gui")
add_executable("gui-tests"
"tests/gtk-test.cpp"
"tests/messages.cpp"
+ "tests/resources.cpp"
)
target_link_libraries("gui-tests" PRIVATE
diff --git a/gui/tests/resources.cpp b/gui/tests/resources.cpp
index 97a1a6b..ccabf74 100644
--- a/gui/tests/resources.cpp
+++ b/gui/tests/resources.cpp
@@ -10,7 +10,7 @@
#include <format>
-TEST_CASE("UI resources")
+SCENARIO("Resources are correctly bundled")
{
auto file = GENERATE("/ch/arknet/Turns/participant_editor.ui",
@@ -19,8 +19,16 @@ TEST_CASE("UI resources")
"/ch/arknet/Turns/tracker.ui",
"/ch/arknet/Turns/turn_order_view.ui");
- SECTION(std::format("contains {}", file))
+ GIVEN(std::format("The resource path '{}'", file))
{
- REQUIRE(Gio::Resource::get_file_exists_global_nothrow(file));
+ WHEN("looking for a global resource at that path")
+ {
+ auto exists = Gio::Resource::get_file_exists_global_nothrow(file);
+
+ THEN("one exists")
+ {
+ REQUIRE(exists);
+ }
+ }
}
}