Skip to content

Commit 49f6f57

Browse files
committed
fix: stabilize headless CI and RPM tests
1 parent bc48af4 commit 49f6f57

3 files changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
run: cmake --build build --parallel
5757

5858
- name: Run tests
59+
env:
60+
QT_QPA_PLATFORM: offscreen
61+
QT_QUICK_CONTROLS_STYLE: Basic
5962
run: ctest --test-dir build --output-on-failure
6063

6164
- name: Validate desktop metadata

packaging/rpm/ro-control.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ tar -xzf %{SOURCE0} --strip-components=1
6969
%cmake_install
7070

7171
%check
72+
export QT_QPA_PLATFORM=offscreen
73+
export QT_QUICK_CONTROLS_STYLE=Basic
7274
%ctest --output-on-failure
7375

7476
%files
@@ -90,7 +92,7 @@ tar -xzf %{SOURCE0} --strip-components=1
9092
%{_datadir}/polkit-1/actions/io.github.ProjectRoASD.rocontrol.policy
9193

9294
%changelog
93-
* Sat May 10 2026 ro-Control Maintainers <noreply@github.com> - 1.1.0-1
95+
* Sun May 10 2026 ro-Control Maintainers <noreply@github.com> - 1.1.0-1
9496
- Target Fedora 43 for CI, RPM validation, and release builds
9597
- Validate RPM compatibility for x86_64 and aarch64 with store metadata checks
9698
- Align AppStream metadata with real application screenshots and improved package identity

tests/CMakeLists.txt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
find_package(Qt6 REQUIRED COMPONENTS Test Qml Quick QuickControls2)
22

3+
set(RO_CONTROL_TEST_ENV
4+
"QT_QPA_PLATFORM=offscreen;QT_QUICK_CONTROLS_STYLE=Basic"
5+
)
6+
37
function(ro_control_configure_test target_name)
48
target_include_directories(${target_name} PRIVATE
59
${CMAKE_SOURCE_DIR}/src
610
${CMAKE_SOURCE_DIR}/src/backend
711
)
812
endfunction()
913

14+
function(ro_control_register_test test_name)
15+
add_test(NAME ${test_name} COMMAND ${test_name})
16+
set_tests_properties(${test_name} PROPERTIES
17+
ENVIRONMENT "${RO_CONTROL_TEST_ENV}"
18+
)
19+
endfunction()
20+
1021
# ─── Detector Tests ──────────────────────────────────────────────────────────
1122
qt_add_executable(test_detector
1223
test_detector.cpp
@@ -19,7 +30,7 @@ target_link_libraries(test_detector PRIVATE
1930
ro-control-backend
2031
)
2132

22-
add_test(NAME test_detector COMMAND test_detector)
33+
ro_control_register_test(test_detector)
2334

2435
# ─── Updater/Version Parser Tests ────────────────────────────────────────────
2536
qt_add_executable(test_updater
@@ -33,7 +44,7 @@ target_link_libraries(test_updater PRIVATE
3344
ro-control-backend
3445
)
3546

36-
add_test(NAME test_updater COMMAND test_updater)
47+
ro_control_register_test(test_updater)
3748

3849
# ─── Monitor Tests ───────────────────────────────────────────────────────────
3950
qt_add_executable(test_monitor
@@ -47,7 +58,7 @@ target_link_libraries(test_monitor PRIVATE
4758
ro-control-backend
4859
)
4960

50-
add_test(NAME test_monitor COMMAND test_monitor)
61+
ro_control_register_test(test_monitor)
5162

5263
# ─── Preferences / Localization Tests ───────────────────────────────────────
5364
qt_add_executable(test_preferences
@@ -62,7 +73,7 @@ target_link_libraries(test_preferences PRIVATE
6273
ro-control-backend
6374
)
6475

65-
add_test(NAME test_preferences COMMAND test_preferences)
76+
ro_control_register_test(test_preferences)
6677

6778
# ─── System Integration Tests ───────────────────────────────────────────────
6879
qt_add_executable(test_system_integration
@@ -76,7 +87,7 @@ target_link_libraries(test_system_integration PRIVATE
7687
ro-control-backend
7788
)
7889

79-
add_test(NAME test_system_integration COMMAND test_system_integration)
90+
ro_control_register_test(test_system_integration)
8091

8192
# ─── Metadata Tests ──────────────────────────────────────────────────────────
8293
qt_add_executable(test_metadata
@@ -92,7 +103,7 @@ target_link_libraries(test_metadata PRIVATE
92103
Qt6::Test
93104
)
94105

95-
add_test(NAME test_metadata COMMAND test_metadata)
106+
ro_control_register_test(test_metadata)
96107

97108
# ─── CLI Tests ───────────────────────────────────────────────────────────────
98109
qt_add_executable(test_cli
@@ -107,7 +118,7 @@ target_link_libraries(test_cli PRIVATE
107118
ro-control-backend
108119
)
109120

110-
add_test(NAME test_cli COMMAND test_cli)
121+
ro_control_register_test(test_cli)
111122

112123
# ─── Driver Page QML Integration Tests ──────────────────────────────────────
113124
qt_add_executable(test_driver_page
@@ -127,7 +138,4 @@ target_link_libraries(test_driver_page PRIVATE
127138
Qt6::Test
128139
)
129140

130-
add_test(NAME test_driver_page COMMAND test_driver_page)
131-
set_tests_properties(test_driver_page PROPERTIES
132-
ENVIRONMENT "QT_QPA_PLATFORM=offscreen;QT_QUICK_CONTROLS_STYLE=Basic"
133-
)
141+
ro_control_register_test(test_driver_page)

0 commit comments

Comments
 (0)