#!perl

use 5.010001;
use strict;
use warnings;

use Getopt::Long qw(:config bundling no_ignore_case auto_help auto_version);
use Test::Sah::Filter;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-10-17'; # DATE
our $DIST = 'Test-Sah-Filter'; # DIST
our $VERSION = '0.005'; # VERSION

my %opts = (
    exclude_modules => [],
    include_modules => [],
    test_examples => 1,
    test_perl_filters => 1,
    test_js_filters => 1,
);
GetOptions(
    'include-module=s' => $opts{include_modules},
    '<>' => sub {
        push @{ $opts{include_modules} }, $_[0];
    },
    'exclude-module=s' => $opts{exclude_modules},
    'E' => sub { $opts{test_examples} = 0 },
    'test-perl-filters!' => \$opts{test_perl_filters},
    'test-js-filters!' => \$opts{test_js_filters},
);

sah_filter_modules_ok(
    \%opts,
);

1;
# ABSTRACT: Test all Data::Sah::Filter::* modules in distribution
# PODNAME: test-sah-filter-modules

__END__

=pod

=encoding UTF-8

=head1 NAME

test-sah-filter-modules - Test all Data::Sah::Filter::* modules in distribution

=head1 VERSION

This document describes version 0.005 of test-sah-filter-modules (from Perl distribution Test-Sah-Filter), released on 2022-10-17.

=head1 SYNOPSIS

In your dist directory:

 % test-sah-filter-modules [options] [included_module]...

Examples:

 # test all Data::Sah::Filter::* modules in dist
 % test-sah-filter-modules

 # only test a single module
 % test-sah-filter-modules --include-module perl::Str::check

 # only test a couple of modules
 % test-sah-filter-modules perl::Str::check js::Str::downcase

 # do not test JS filters
 % test-sah-filter-modules --notest-js
 % test-sah-filter-modules --no-test-js-filters

=head1 DESCRIPTION

This script is a command-line interface for L<Test::Sah::Filter>'s
C<sah_filter_modules_ok()> function.

=head1 OPTIONS

=over

=item * --include-modules=s

Include a module. Can be specified multiple times. If specified then only
included modules will be tested.

=item * --exclude-modules=s

Exclude a module. Can be specified multiple times.

=item * -E

This sets C<test_examples> to 0 to skip testing examples in filter modules.

=item * --no-test-js-filters

This sets C<test_js_filters> to 0 to skip C<Data::Sah::Filter::js::*> modules.

=item * --no-test-perl-filters

This sets C<test_perl_filters> to 0 to skip C<Data::Sah::Filter::perl::*>
modules.

=back

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/Test-Sah-Filter>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-Test-Sah-Filter>.

=head1 SEE ALSO

L<Test::Sah::Filter>

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 CONTRIBUTING


To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.

Most of the time, you don't need to build the distribution yourself. You can
simply modify the code, then test via:

 % prove -l

If you want to build the distribution (e.g. to try to install it locally on your
system), you can install L<Dist::Zilla>,
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
that are considered a bug and can be reported to me.

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by perlancar <perlancar@cpan.org>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Sah-Filter>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=cut
