#!/usr/bin/perl
use strict;
use warnings;

if ( grep { m/^-+h(elp)?$/ } @ARGV ) {
    print <<EOT;

USAGE: $0 (file|-) (item|-) prove args

Fennec test file item is optional, use -- for none

Wrapper for:

    \$ FENNEC_FILE="file" FENNEC_ITEM="item" prove [args] t/Fennec.t

EOT
    exit;
}

my ( $file, $item, @prove_args ) = @ARGV;

my $run = "";
$run = "FENNEC_FILE='$file' " if $file and $file ne '-';
$run .= "FENNEC_ITEM='$item' " if $item and $item ne '-';
my $runner = 't/Fennec.t';
$runner = -e 't/Fennec.t' ? 't/Fennec.t' : `fennec_run.pl`;
$run .= "prove " . join(' ', @prove_args) . " $runner";

print $run . "\n";
exec $run;

=head1 AUTHORS

Chad Granum L<exodist7@gmail.com>

=head1 COPYRIGHT

Copyright (C) 2010 Chad Granum

Fennec is free software; Standard perl licence.

Fennec is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the license for more details.
