xref: /openbsd-src/gnu/usr.bin/perl/cpan/podlators/t/style/kwalitee.t (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
1*f2a19305Safresh1#!/usr/bin/perl
2*f2a19305Safresh1#
3*f2a19305Safresh1# Test Perl code using the Kwalitee metrics from CPANTS.
4*f2a19305Safresh1#
5*f2a19305Safresh1# The canonical version of this file is maintained in the rra-c-util package,
6*f2a19305Safresh1# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
7*f2a19305Safresh1#
8*f2a19305Safresh1# Written by Russ Allbery <eagle@eyrie.org>
9*f2a19305Safresh1# Copyright 2022 Russ Allbery <eagle@eyrie.org>
10*f2a19305Safresh1#
11*f2a19305Safresh1# Permission is hereby granted, free of charge, to any person obtaining a
12*f2a19305Safresh1# copy of this software and associated documentation files (the "Software"),
13*f2a19305Safresh1# to deal in the Software without restriction, including without limitation
14*f2a19305Safresh1# the rights to use, copy, modify, merge, publish, distribute, sublicense,
15*f2a19305Safresh1# and/or sell copies of the Software, and to permit persons to whom the
16*f2a19305Safresh1# Software is furnished to do so, subject to the following conditions:
17*f2a19305Safresh1#
18*f2a19305Safresh1# The above copyright notice and this permission notice shall be included in
19*f2a19305Safresh1# all copies or substantial portions of the Software.
20*f2a19305Safresh1#
21*f2a19305Safresh1# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22*f2a19305Safresh1# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23*f2a19305Safresh1# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
24*f2a19305Safresh1# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25*f2a19305Safresh1# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26*f2a19305Safresh1# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27*f2a19305Safresh1# DEALINGS IN THE SOFTWARE.
28*f2a19305Safresh1#
29*f2a19305Safresh1# SPDX-License-Identifier: MIT
30*f2a19305Safresh1
31*f2a19305Safresh1use 5.010;
32*f2a19305Safresh1use strict;
33*f2a19305Safresh1use warnings;
34*f2a19305Safresh1
35*f2a19305Safresh1use lib 't/lib';
36*f2a19305Safresh1
37*f2a19305Safresh1use Test::RRA qw(skip_unless_author use_prereq);
38*f2a19305Safresh1
39*f2a19305Safresh1use Test::More;
40*f2a19305Safresh1
41*f2a19305Safresh1# Skip tests unless we're running author tests.
42*f2a19305Safresh1skip_unless_author('Distribution style tests');
43*f2a19305Safresh1
44*f2a19305Safresh1# Load prerequisite module.
45*f2a19305Safresh1use_prereq('Test::Kwalitee', 'kwalitee_ok');
46*f2a19305Safresh1
47*f2a19305Safresh1# Do the testing.  Disable testing for use strict, since that's done as part
48*f2a19305Safresh1# of a separate test.  Disable testing for META.yml if it's not present, since
49*f2a19305Safresh1# it's generated as part of the distribution process but isn't normally
50*f2a19305Safresh1# present in a development tree.
51*f2a19305Safresh1my @options = qw(-use_strict);
52*f2a19305Safresh1if (!-e 'META.yml') {
53*f2a19305Safresh1    push(@options, '-has_meta_yml');
54*f2a19305Safresh1}
55*f2a19305Safresh1kwalitee_ok(@options);
56*f2a19305Safresh1done_testing();
57