Files
perl-Test-TableDriven/perl-Test-TableDriven.spec

70 lines
2.2 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-Test-TableDriven
#
# 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-TableDriven
Name: perl-Test-TableDriven
Version: 0.20.0
Release: 0
# 0.02 -> normalize -> 0.20.0
%define cpan_version 0.02
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Write tests, not scripts that run them
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/J/JR/JROCKWAY/%{cpan_name}-%{cpan_version}.tar.gz
2025-08-12 18:17:55 +02:00
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
Provides: perl(Test::TableDriven) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
Writing table-driven tests is usually a good idea. Adding a test case
doesn't require adding code, so it's easy to avoid fucking up the other
tests. However, actually going from a table of tests to a test that runs is
non-trivial.
'Test::TableDriven' makes writing the test drivers trivial. You simply
define your test cases and write a function that turns the input data into
output data to compare against. 'Test::TableDriven' will compute how many
tests need to be run, and then run the tests.
Concentrate on your data and what you're testing, not 'plan tests =' scalar
keys %test_cases> and a big foreach loop.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
PERL_USE_UNSAFE_INC=1 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
%changelog