From e2d8838fca209eaaa226c0764c39be5e1f7eae1b Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 10 Jan 2025 16:50:48 +0100 Subject: [PATCH] rpm: Run unit tests --- dist/unix/strawberry.spec.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dist/unix/strawberry.spec.in b/dist/unix/strawberry.spec.in index 96be3e717..cf9ede2b0 100644 --- a/dist/unix/strawberry.spec.in +++ b/dist/unix/strawberry.spec.in @@ -63,6 +63,8 @@ BuildRequires: pkgconfig(libcdio) BuildRequires: pkgconfig(libebur128) BuildRequires: pkgconfig(libgpod-1.0) BuildRequires: pkgconfig(libmtp) +BuildRequires: cmake(GTest) +BuildRequires: pkgconfig(gmock) %if 0%{?suse_version} Requires: qt6-sql-sqlite @@ -106,10 +108,10 @@ Features: export CXXFLAGS="-fPIC $RPM_OPT_FLAGS" %endif %if "%{?_vendor}" == "openmandriva" -%{cmake} -DQT_VERSION_MAJOR=@QT_VERSION_MAJOR@ -DENABLE_TRANSLATIONS=OFF +%{cmake} %make_build %else -%{cmake} -DQT_VERSION_MAJOR=@QT_VERSION_MAJOR@ +%{cmake} %cmake_build %endif @@ -120,11 +122,11 @@ Features: %cmake_install %endif -%if 0%{?suse_version} - %suse_update_desktop_file org.strawberrymusicplayer.strawberry Qt AudioVideo Audio Player -%endif - %check +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos} +%else +QT_QPA_PLATFORM="offscreen" %{make_build} -j $(nproc) -C build strawberry_tests +%endif desktop-file-validate %{buildroot}%{_datadir}/applications/org.strawberrymusicplayer.strawberry.desktop %if 0%{?suse_version} appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/org.strawberrymusicplayer.strawberry.appdata.xml