# # spec file for package perl-Test-Uses # # 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-Uses Name: perl-Test-Uses Version: 0.10.0 Release: 0 # 0.01 -> normalize -> 0.10.0 %define cpan_version 0.01 License: Artistic-2.0 Summary: Test sources for presence/absence of particular modules URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/S/SN/SNKWATT/%{cpan_name}-%{cpan_version}.tar.gz Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(ExtUtils::MakeMaker) >= 6.31 BuildRequires: perl(PPI) >= 1.205 BuildRequires: perl(Test::Tester) Requires: perl(PPI) >= 1.205 Provides: perl(Test::Uses) = %{version} %undefine __perllib_provides %{perl_requires} %description This is a test helper module, so it is designed to be used in cooperation with other test modules, such as Test::Simple and Test::More. The module helps you check through a bunch of code for references to modules you either (a) want to use, or (b) want to avoid. The module reads and parses the file (using PPI, and, therefore, dependencies of the file are not checked). the syntactic check has some advantages. Because no actual code is loaded, it is safe to use as a test. One of the best reasons for using this, is to handle code where your production environment may limit use of modules. This test allows you to avoid modules that you know are going to cause problems, by adding test cases which fail when people write code that uses them. Because pragmas are invoked similarly, you can also detect use of "bad" pragmas. Note that a pragma turned off (e.g., "no bytes") still counts as using the pragma, and will be found as a use by this module. This seemed more sensible to me, as in virtually all cases, using "no" loads the component and requires it to function, and this is generally what you are trying to find using these tests. Test::Uses is not the same as Test::use::ok or Test::More::use_ok, which checks that these modules can be use()d successfully. %prep %autosetup -n %{cpan_name}-%{cpan_version} %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.txt README %changelog