From d58664bc08274973c79aeca1393434b4a98430c1 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 2 Apr 2024 16:53:29 +0200 Subject: [PATCH] Add -tests subpackage with unit tests that can run in CI Resolves: RHEL-28239 --- qt6-qtwayland.spec | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/qt6-qtwayland.spec b/qt6-qtwayland.spec index dee5c36..c395bd2 100644 --- a/qt6-qtwayland.spec +++ b/qt6-qtwayland.spec @@ -7,11 +7,12 @@ %endif %global examples 1 +%global build_tests 1 Summary: Qt6 - Wayland platform support and QtCompositor module Name: qt6-%{qt_module} Version: 6.6.1 -Release: 5%{?dist} +Release: 6%{?dist} License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 Url: http://www.qt.io @@ -78,19 +79,37 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %{summary}. %endif +%if 0%{?build_tests} +%package tests +Summary: Unit tests for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +%description tests +%{summary}. +%endif + %prep %autosetup -n %{qt_module}-everywhere-src-%{qt_version}%{?unstable:-%{prerelease}} -p1 %build -%cmake_qt6 -DQT_BUILD_EXAMPLES:BOOL=%{?examples:ON}%{!?examples:OFF} +%cmake_qt6 \ + -DQT_BUILD_EXAMPLES:BOOL=%{?examples:ON}%{!?examples:OFF} \ + -DQT_BUILD_TESTS=%{?build_tests:ON}%{!?build_tests:OFF} %cmake_build %install +%if 0%{?build_tests} +%qt6_dont_autoinstall_tests +%endif + %cmake_install +%if 0%{?build_tests} +%qt6_install_tests +%endif + ## .prl/.la file love # nuke .prl reference(s) to %%buildroot, excessive (.la-like) libs pushd %{buildroot}%{_qt6_libdir} @@ -174,7 +193,16 @@ popd %{_qt6_examplesdir}/wayland/ %endif +%if 0%{?build_tests} +%files tests +%{_qt6_archdatadir}/tests +%endif + %changelog +* Tue Apr 02 2024 Jan Grulich - 6.6.1-6 +- Add -tests subpackage with unit tests that can run in CI + Resolves: RHEL-28239 + * Thu Feb 08 2024 Jan Grulich - 6.6.1-5 - Backport upstream fix: Fix Qt::KeypadModifier for key events