File perl-TAP-Formatter-JUnit.spec of Package perl-TAP-Formatter-JUnit
#
# spec file for package perl-TAP-Formatter-JUnit
#
# Copyright (c) 2025 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 TAP-Formatter-JUnit
Name: perl-TAP-Formatter-JUnit
Version: 0.170.0
Release: 0
# 0.17 -> normalize -> 0.170.0
%define cpan_version 0.17
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Harness output delegate for JUnit output
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/G/GT/GTERMARS/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(File::Slurp)
BuildRequires: perl(IO::Scalar)
BuildRequires: perl(IPC::Run)
BuildRequires: perl(Moose)
BuildRequires: perl(MooseX::NonMoose)
BuildRequires: perl(TAP::Harness) >= 3.12
BuildRequires: perl(Test::DiagINC) >= 0.2.0
BuildRequires: perl(Test::More) >= 0.96
BuildRequires: perl(Test::XML)
BuildRequires: perl(XML::Generator)
BuildRequires: perl(namespace::clean)
BuildRequires: perl(version)
Requires: perl(File::Slurp)
Requires: perl(Moose)
Requires: perl(MooseX::NonMoose)
Requires: perl(TAP::Harness) >= 3.12
Requires: perl(XML::Generator)
Requires: perl(namespace::clean)
Provides: perl(TAP::Formatter::JUnit) = %{version}
Provides: perl(TAP::Formatter::JUnit::Result)
Provides: perl(TAP::Formatter::JUnit::Session)
%undefine __perllib_provides
%{perl_requires}
%description
*This code is currently in alpha state and is subject to change.*
'TAP::Formatter::JUnit' provides JUnit output formatting for
'TAP::Harness'.
By default (e.g. when run with _prove_), the _entire_ test suite is
gathered together into a single JUnit XML document, which is then displayed
on 'STDOUT'. You can, however, have individual JUnit XML files dumped for
each individual test, by setting 'PERL_TEST_HARNESS_DUMP_TAP' to a
directory that you would like the JUnit XML dumped to. Note, that this will
*also* cause 'TAP::Harness' to dump the original TAP output into that
directory as well (but IMHO that's ok as you've now got the data in two
parseable formats).
Timing information is included in the JUnit XML, _if_ you specified
'--timer' when you ran _prove_.
In standard use, a "passing TODO" is treated as failure conditions (and is
reported as such in the generated JUnit). If you wish to treat these as a
"pass" and not a "fail" condition, setting 'ALLOW_PASSING_TODOS' in your
environment will turn these into pass conditions.
The JUnit output generated is partial to being grokked by Hudson
(http://hudson.dev.java.net/). That's the build tool I'm using at the
moment and needed to be able to generate JUnit output for.
%prep
%autosetup -n %{cpan_name}-%{cpan_version} -p1
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%license LICENSE
%changelog