Add gating tests

Resolves: bz#1968459
This commit is contained in:
Jan Grulich 2021-06-09 09:40:33 +02:00
parent f7fe3ae40d
commit 3f4ec0da60

View File

@ -49,13 +49,15 @@ BuildRequires: make
BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libsystemd)
%global examples 1 %global examples 1
%global build_tests 1
## skip for now, until we're better at it --rex ## skip for now, until we're better at it --rex
#global tests 1 #global tests 1
Name: qt5-qtbase Name: qt5-qtbase
Summary: Qt5 - QtBase components Summary: Qt5 - QtBase components
Version: 5.15.2 Version: 5.15.2
Release: 17%{?dist} Release: 18%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details # See LGPL_EXCEPTIONS.txt, for exception details
@ -215,7 +217,7 @@ BuildRequires: perl-generators
BuildRequires: python3 BuildRequires: python3
BuildRequires: qt5-rpm-macros BuildRequires: qt5-rpm-macros
%if 0%{?tests} %if 0%{?build_tests}
BuildRequires: dbus-x11 BuildRequires: dbus-x11
BuildRequires: mesa-dri-drivers BuildRequires: mesa-dri-drivers
BuildRequires: time BuildRequires: time
@ -298,6 +300,15 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description examples %description examples
%{summary}. %{summary}.
%if 0%{?build_tests}
%package tests
Summary: Unit tests for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description tests
%{summary}.
%endif
%package static %package static
Summary: Static library files for %{name} Summary: Static library files for %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
@ -483,7 +494,7 @@ export MAKEFLAGS="%{?_smp_mflags}"
-optimized-qmake \ -optimized-qmake \
%{?openssl} \ %{?openssl} \
%{!?examples:-nomake examples} \ %{!?examples:-nomake examples} \
%{!?tests:-nomake tests} \ %{!?build_tests:-nomake tests} \
-no-pch \ -no-pch \
-no-reduce-relocations \ -no-reduce-relocations \
-no-rpath \ -no-rpath \
@ -519,10 +530,29 @@ make clean -C qmake
%make_build %make_build
%if 0%{?build_tests}
%qt5_build_tests
%endif
%install %install
make install INSTALL_ROOT=%{buildroot} make install INSTALL_ROOT=%{buildroot}
%if 0%{?build_tests}
# Install tests for gating
%qt5_install_tests
# Fix mangling shebangs
sed -i s@\/usr\/bin\/python@\/usr\/bin\/python3@ %{buildroot}%{_qt5_libdir}/qt5/tests/manual/xembed-widgets/gtk-embedder.py
sed -i s@\/usr\/bin\/python@\/usr\/bin\/python3@ %{buildroot}%{_qt5_libdir}/qt5/tests/manual/xembed-raster/gtk-embedder.py
# Remove tests which will produce error when checking rpath
rm -rf %{buildroot}%{_qt5_libdir}/qt5/tests/auto/corelib/plugin/qpluginloader/elftest
# Remove android stuff which will just add us dependencies on Perl modules
rm -rf %{buildroot}%{_qt5_libdir}/qt5/tests/auto/android
# Remove apache server which will just add us dependencies on Perl modules
rm -rf %{buildroot}%{_qt5_libdir}/qt5/tests/testserver/apache2
%endif
install -m644 -p -D %{SOURCE1} %{buildroot}%{_qt5_datadir}/qtlogging.ini install -m644 -p -D %{SOURCE1} %{buildroot}%{_qt5_datadir}/qtlogging.ini
# Qt5.pc # Qt5.pc
@ -964,6 +994,11 @@ fi
%{_qt5_examplesdir}/ %{_qt5_examplesdir}/
%endif %endif
%if 0%{?build_tests}
%files tests
%{_qt5_libdir}/qt5/tests
%endif
%if "%{?ibase}" != "-no-sql-ibase" %if "%{?ibase}" != "-no-sql-ibase"
%files ibase %files ibase
%{_qt5_plugindir}/sqldrivers/libqsqlibase.so %{_qt5_plugindir}/sqldrivers/libqsqlibase.so
@ -1061,6 +1096,10 @@ fi
%changelog %changelog
* Wed Jun 09 2021 Jan Grulich <jgrulich@redhat.com> - 5.15.2-18
- Add gating tests
Resolves: bz#1968459
* Tue Jun 01 2021 Jan Grulich <jgrulich@redhat.com> - 5.15.2-17 * Tue Jun 01 2021 Jan Grulich <jgrulich@redhat.com> - 5.15.2-17
- Do not use Wayland backend by default on GNOME wayland session - Do not use Wayland backend by default on GNOME wayland session
Resolves: bz#1966425 Resolves: bz#1966425