From 56fc361c2d2d33ff6acdfa408af543367ae39954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Thu, 25 Oct 2018 16:34:44 +0200 Subject: [PATCH] Run valgrind-memcheck --- libxcrypt.spec | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libxcrypt.spec b/libxcrypt.spec index 10749a5..43a9a12 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -6,6 +6,15 @@ #endif +# Run memcheck? +# Valgrind does not work well on %%{power64} arches. +%ifnarch %{power64} +%bcond_without memcheck +%else +%bcond_with memcheck +%endif + + # Shared object version of libcrypt. %if %{with new_api} %global soc 2 @@ -48,6 +57,11 @@ --enable-shared \\\ --enable-static \\\ --disable-failure-tokens \\\ +%if %{with memcheck} \ + --enable-valgrind \\\ +%else \ + --disable-valgrind \\\ +%endif \ --srcdir=.. \\\ --with-pkgconfigdir=%{_libdir}/pkgconfig @@ -89,6 +103,9 @@ Patch0001: %{url}/compare/v%{version}...develop.patch#/%{name}-%{version}-t BuildRequires: fipscheck BuildRequires: libtool +%if %{with memcheck} +BuildRequires: valgrind +%endif # We do not need to keep this forever. %if %{without new_api} && (0%{?fedora} && 0%{?fedora} <= 31) || (0%{?rhel} && 0%{?rhel} <= 10) @@ -260,6 +277,16 @@ for dir in %{_vpath_builddir}; do echo "-----END TESTLOG: ${dir}-----"; exit $rc; } +%if %{with memcheck} + %make_build -C ${dir} check-valgrind-memcheck || \ + { + rc=$?; + echo "-----BEGIN TESTLOG: ${dir}-----"; + %{__cat} ${dir}/test-suite-memcheck.log; + echo "-----END TESTLOG: ${dir}-----"; + exit $rc; + } +%endif done @@ -310,6 +337,7 @@ done %changelog * Thu Oct 25 2018 Björn Esser - 4.2.2-2 - Add patch updating to recent development version +- Run valgrind-memcheck * Thu Oct 18 2018 Björn Esser - 4.2.2-1 - New upstream release