From 2e7ee731c45a60ade6106e9e2dcaa8c949e8872e Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 28 Mar 2024 15:59:10 +0100 Subject: [PATCH] Add -tests subpackage with unit tests that can run in CI Resolves: RHEL-28239 --- qt6-qtremoteobjects.spec | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/qt6-qtremoteobjects.spec b/qt6-qtremoteobjects.spec index 19a85f0..adec067 100644 --- a/qt6-qtremoteobjects.spec +++ b/qt6-qtremoteobjects.spec @@ -7,11 +7,13 @@ %endif %global examples 1 +# FIXME: needs bootstrap +%global build_tests 1 Summary: Qt6 - Qt Remote Objects Name: qt6-%{qt_module} Version: 6.6.1 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0 Url: http://www.qt.io @@ -54,19 +56,39 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %{summary}. %endif +%if 0%{?build_tests} +%package tests +Summary: Unit tests for %{name} +BuildRequires: qt6-qtconnectivity-devel >= %{version} +BuildRequires: qt6-qtdeclarative-static >= %{version} +BuildRequires: qt6-qtremoteobjects-devel >= %{version} +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 %ldconfig_scriptlets @@ -106,8 +128,16 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %{_qt6_examplesdir}/ %endif +%if 0%{?build_tests} +%files tests +%{_qt6_archdatadir}/tests +%endif %changelog +* Thu Mar 28 2024 Jan Grulich - 6.6.1-4 +- Add -tests subpackage with unit tests that can run in CI + Resolves: RHEL-28239 + * Fri Jan 26 2024 Fedora Release Engineering - 6.6.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild