perl-Test-Count / modules / Test-Count / lib / Test / Count / Filter / ByFileType /

package Test::Count::Filter::ByFileType::App;

use strict;
use warnings;

use Test::Count::Filter;
use Getopt::Long;

use base 'Exporter';

our @EXPORT = (qw(run));

=encoding utf8

=head1 NAME

Test::Count::Filter::ByFileType::App - a standalone command line application 
that filters according to the filetype.


    # To filter C code
    $ perl -MTest::Count::Filter::ByFileType::App -e 'run()' --ft=c

    # To filter Perl 5 code
    $ perl -MTest::Count::Filter::ByFileType::App -e 'run()'


=head2 run()

Runs the program.


sub run
    my $filetype = "perl";
    GetOptions('ft=s' => \$filetype);

    my %params =
        'lisp' => 
            assert_prefix_regex => qr{; TEST},
            plan_prefix_regex => qr{\(plan\s+},
        'c' =>
            assert_prefix_regex => qr{/[/\*]\s+TEST},
            plan_prefix_regex => qr{\s*plan_tests\s*\(\s*},
        'python' =>
            plan_prefix_regex => qr{plan\s*\(\s*},

    my %aliases =
        'arc' => "lisp",
        'scheme' => "lisp",
        'cpp' => "c",

    $filetype = exists($aliases{$filetype}) ? $aliases{$filetype} : $filetype;
    my $ft_params = exists($params{$filetype}) ? $params{$filetype} : +{};

    my $filter = 


    return 0;



=head1 AUTHOR

Shlomi Fish, L<> .

=head1 BUGS

Please report any bugs or feature requests to
C<bug-test-count at>, or through the web interface at
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Test::Count

You can also look for information at:

=over 4

=item * AnnoCPAN: Annotated CPAN documentation


=item * CPAN Ratings


=item * RT: CPAN's request tracker


=item * Search CPAN



=head1 SEE ALSO

L<Test::Count>, L<Test::Count::Parser>



Copyright 2009 Shlomi Fish.

This program is released under the following license: MIT X11.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.