Add -tests subpackage with unit tests that can run in CI
Resolves: RHEL-28239
This commit is contained in:
parent
b86cf1c123
commit
31b5531655
@ -12,11 +12,12 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global examples 1
|
%global examples 1
|
||||||
|
%global build_tests 1
|
||||||
|
|
||||||
Summary: Qt6 - QtDeclarative component
|
Summary: Qt6 - QtDeclarative component
|
||||||
Name: qt6-%{qt_module}
|
Name: qt6-%{qt_module}
|
||||||
Version: 6.6.1
|
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
|
License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
Url: http://www.qt.io
|
Url: http://www.qt.io
|
||||||
@ -92,24 +93,49 @@ Provides: qt6-qtquickcontrols2-examples = %{version}-%{release}
|
|||||||
%{summary}.
|
%{summary}.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?build_tests}
|
||||||
|
%package tests
|
||||||
|
Summary: Unit tests for %{name}
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description tests
|
||||||
|
%{summary}.
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{qt_module}-everywhere-src-%{qt_version}%{?unstable:-%{prerelease}} -p1
|
%autosetup -n %{qt_module}-everywhere-src-%{qt_version}%{?unstable:-%{prerelease}} -p1
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
# HACK so calls to "python" get what we want
|
# HACK so calls to "python" get what we want
|
||||||
ln -s %{__python3} python
|
ln -s %{__python3} python
|
||||||
export PATH=`pwd`:$PATH
|
export PATH=`pwd`:$PATH
|
||||||
|
|
||||||
%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}
|
||||||
|
|
||||||
|
# FIXME: tests/auto/qml/qmltc doesn't build
|
||||||
|
sed -i 's|add_subdirectory(qmltc)||' tests/auto/qml/CMakeLists.txt
|
||||||
|
|
||||||
|
%if 0%{?build_tests}
|
||||||
|
%qt6_fix_tests
|
||||||
|
%endif
|
||||||
|
|
||||||
%cmake_build
|
%cmake_build
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if 0%{?build_tests}
|
||||||
|
%qt6_dont_autoinstall_tests
|
||||||
|
%endif
|
||||||
|
|
||||||
%cmake_install
|
%cmake_install
|
||||||
|
|
||||||
|
%if 0%{?build_tests}
|
||||||
|
%qt6_install_tests
|
||||||
|
%endif
|
||||||
|
|
||||||
%ifarch %{multilib_archs}
|
%ifarch %{multilib_archs}
|
||||||
# multilib: qv4global_p.h
|
# multilib: qv4global_p.h
|
||||||
mv %{buildroot}%{_qt6_headerdir}/QtQml/%{qt_version}/QtQml/private/qv4global_p.h \
|
mv %{buildroot}%{_qt6_headerdir}/QtQml/%{qt_version}/QtQml/private/qv4global_p.h \
|
||||||
@ -159,7 +185,6 @@ time \
|
|||||||
make check -k -C tests ||:
|
make check -k -C tests ||:
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -334,7 +359,16 @@ make check -k -C tests ||:
|
|||||||
%{_qt6_examplesdir}/
|
%{_qt6_examplesdir}/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if 0%{?build_tests}
|
||||||
|
%files tests
|
||||||
|
%{_qt6_archdatadir}/tests
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 27 2024 Jan Grulich <jgrulich@redhat.com> - 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 <releng@fedoraproject.org> - 6.6.1-3
|
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 6.6.1-3
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user