Run tests in %check

Build and run the provided tests in %check. The locale needs to be
overriden to C.UTF-8 to make the Qt4 tests pass due to an issue with
Japanese character handling.

It is possible to disable the tests by building with `--without test`
(for example `fedpkg mockbuild --without test`).

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
epel9
Ondrej Mosnacek 4 years ago
parent 5f66a78cb0
commit 7f860843d7

@ -1,5 +1,7 @@
%undefine __cmake_in_source_build
%bcond_without test
Name: quazip
Version: 1.1
Release: 3%{?dist}
@ -144,6 +146,26 @@ install -d %{buildroot}%{_datadir}/cmake/Modules
install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindQuaZip.cmake
install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/cmake/Modules/FindQuaZip5.cmake
%if %{with test}
%check
# Qt4 uses the locale rather than libicu to determine file name encoding.
# Thus we need to force a UTF-8 locale, otherwise the tests will fail
# under Qt4.
# https://github.com/stachenov/quazip/issues/127
export LC_ALL=C.UTF-8
# In some emulated environments (such as the s390x mock chroot emulated
# on x86_64) the regexp JIT is broken, so turn it off to avoid incorrect
# test failures.
export QT_ENABLE_REGEXP_JIT=0
%global _vpath_builddir build-qt4
%cmake_build -t check
%global _vpath_builddir build-qt5
%cmake_build -t check
%global _vpath_builddir build-qt6
%cmake_build -t check
%endif
%ldconfig_scriptlets
%files

Loading…
Cancel
Save