File perl-Test-Valgrind.spec of Package perl-Test-Valgrind

#
# spec file for package perl-Test-Valgrind
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define cpan_name Test-Valgrind
Name:           perl-Test-Valgrind
Version:        1.190.0
Release:        0
# 1.19 -> normalize -> 1.190.0
%define cpan_version 1.19
License:        Artistic-1.0 OR GPL-1.0-or-later
Summary:        Generate suppressions, analyse and test any command with valgrind
URL:            https://metacpan.org/release/%{cpan_name}
Source0:        https://cpan.metacpan.org/authors/id/V/VP/VPIT/%{cpan_name}-%{cpan_version}.tar.gz
Source1:        cpanspec.yml
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Env::Sanctify)
BuildRequires:  perl(File::HomeDir) >= 0.86
BuildRequires:  perl(File::Temp) >= 0.19
BuildRequires:  perl(Perl::Destruct::Level)
BuildRequires:  perl(XML::Twig)
Requires:       perl(Env::Sanctify)
Requires:       perl(File::HomeDir) >= 0.86
Requires:       perl(File::Temp) >= 0.19
Requires:       perl(Perl::Destruct::Level)
Requires:       perl(XML::Twig)
Provides:       perl(Test::Valgrind) = %{version}
Provides:       perl(Test::Valgrind::Action) = %{version}
Provides:       perl(Test::Valgrind::Action::Captor) = %{version}
Provides:       perl(Test::Valgrind::Action::Suppressions) = %{version}
Provides:       perl(Test::Valgrind::Action::Test) = %{version}
Provides:       perl(Test::Valgrind::Carp) = %{version}
Provides:       perl(Test::Valgrind::Command) = %{version}
Provides:       perl(Test::Valgrind::Command::Aggregate) = %{version}
Provides:       perl(Test::Valgrind::Command::Perl) = %{version}
Provides:       perl(Test::Valgrind::Command::PerlScript) = %{version}
Provides:       perl(Test::Valgrind::Component) = %{version}
Provides:       perl(Test::Valgrind::Parser) = %{version}
Provides:       perl(Test::Valgrind::Parser::Suppressions::Text) = %{version}
Provides:       perl(Test::Valgrind::Parser::Text) = %{version}
Provides:       perl(Test::Valgrind::Parser::XML) = %{version}
Provides:       perl(Test::Valgrind::Parser::XML::Twig) = %{version}
Provides:       perl(Test::Valgrind::Parser::XML::Twig::Elt) = %{version}
Provides:       perl(Test::Valgrind::Report) = %{version}
Provides:       perl(Test::Valgrind::Report::Suppressions)
Provides:       perl(Test::Valgrind::Session) = %{version}
Provides:       perl(Test::Valgrind::Suppressions) = %{version}
Provides:       perl(Test::Valgrind::Tool) = %{version}
Provides:       perl(Test::Valgrind::Tool::memcheck) = %{version}
Provides:       perl(Test::Valgrind::Tool::memcheck::Report) = %{version}
Provides:       perl(Test::Valgrind::Util) = %{version}
Provides:       perl(Test::Valgrind::Version) = %{version}
%undefine       __perllib_provides
%{perl_requires}
# MANUAL BEGIN
BuildRequires:  valgrind
# MANUAL END

%description
This module is a front-end to the 'Test::Valgrind::*' API that lets you run
Perl code through the 'memcheck' tool of the 'valgrind' memory debugger, to
test for memory errors and leaks. If they aren't available yet, it will
first generate suppressions for the current 'perl' interpreter and store
them in the portable flavour of
_~/.perl/Test-Valgrind/suppressions/$VERSION_. The actual run will then
take place, and tests will be passed or failed according to the result of
the analysis.

The complete API is much more versatile than this. By declaring an
appropriate Test::Valgrind::Command class, you can run any executable (that
is, not only Perl scripts) under valgrind, generate the corresponding
suppressions on-the-fly and convert the analysis result to TAP output so
that it can be incorporated into your project's testsuite. If you're not
interested in producing TAP, you can output the results in whatever format
you like (for example HTML pages) by defining your own
Test::Valgrind::Action class.

Due to the nature of perl's memory allocator, this module can't track leaks
of Perl objects. This includes non-mortalized scalars and memory cycles.
However, it can track leaks of chunks of memory allocated in XS extensions
with 'Newx' and friends or 'malloc'. As such, it's complementary to the
other very good leak detectors listed in the SEE ALSO section.

%prep
%autosetup  -n %{cpan_name}-%{cpan_version}

%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make_build

%check
make test

%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist

%files -f %{name}.files
%doc Changes README samples

%changelog
openSUSE Build Service is sponsored by