From 7f860843d77b4c3d2d8ac3f091595562e389de01 Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Fri, 20 Aug 2021 18:17:49 +0200 Subject: [PATCH] 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 --- quazip.spec | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/quazip.spec b/quazip.spec index 53f5f39..e78483b 100644 --- a/quazip.spec +++ b/quazip.spec @@ -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