2024-08-03 17:32:13 +00:00
|
|
|
#
|
|
|
|
# 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.
|
2011-05-08 09:59:45 +00:00
|
|
|
|
2024-08-03 17:32:13 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%define cpan_name Test-TableDriven
|
2011-05-08 09:59:45 +00:00
|
|
|
Name: perl-Test-TableDriven
|
2024-08-03 17:32:13 +00:00
|
|
|
Version: 0.20.0
|
2011-05-08 09:59:45 +00:00
|
|
|
Release: 0
|
2024-08-03 17:32:13 +00:00
|
|
|
# 0.02 -> normalize -> 0.20.0
|
|
|
|
%define cpan_version 0.02
|
|
|
|
License: Artistic-1.0 OR GPL-1.0-or-later
|
2011-05-08 09:59:45 +00:00
|
|
|
Summary: Write tests, not scripts that run them
|
2024-08-03 17:32:13 +00:00
|
|
|
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
|
2011-05-08 09:59:45 +00:00
|
|
|
BuildArch: noarch
|
2024-08-03 17:32:13 +00:00
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
|
|
|
Provides: perl(Test::TableDriven) = %{version}
|
|
|
|
%undefine __perllib_provides
|
|
|
|
%{perl_requires}
|
2011-05-08 09:59:45 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Writing table-driven tests is usually a good idea. Adding a test case
|
2024-08-03 17:32:13 +00:00
|
|
|
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
|
2011-05-08 09:59:45 +00:00
|
|
|
define your test cases and write a function that turns the input data into
|
2024-08-03 17:32:13 +00:00
|
|
|
output data to compare against. 'Test::TableDriven' will compute how many
|
2011-05-08 09:59:45 +00:00
|
|
|
tests need to be run, and then run the tests.
|
2024-08-03 17:32:13 +00:00
|
|
|
|
|
|
|
Concentrate on your data and what you're testing, not 'plan tests =' scalar
|
|
|
|
keys %test_cases> and a big foreach loop.
|
2011-05-08 09:59:45 +00:00
|
|
|
|
|
|
|
%prep
|
2024-08-03 17:32:13 +00:00
|
|
|
%autosetup -n %{cpan_name}-%{cpan_version}
|
2011-05-08 09:59:45 +00:00
|
|
|
|
|
|
|
%build
|
2024-08-03 17:32:13 +00:00
|
|
|
PERL_USE_UNSAFE_INC=1 perl Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
%check
|
|
|
|
make test
|
2011-05-08 09:59:45 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2024-08-03 17:32:13 +00:00
|
|
|
%perl_gen_filelist
|
2011-05-08 09:59:45 +00:00
|
|
|
|
2024-08-03 17:32:13 +00:00
|
|
|
%files -f %{name}.files
|
2011-05-08 09:59:45 +00:00
|
|
|
%doc Changes README
|
|
|
|
|
2024-08-03 17:32:13 +00:00
|
|
|
%changelog
|