summaryrefslogtreecommitdiff
path: root/unittest/unit.pl
diff options
context:
space:
mode:
Diffstat (limited to 'unittest/unit.pl')
-rw-r--r--unittest/unit.pl22
1 files changed, 16 insertions, 6 deletions
diff --git a/unittest/unit.pl b/unittest/unit.pl
index 9d328985012..9900f47f374 100644
--- a/unittest/unit.pl
+++ b/unittest/unit.pl
@@ -14,8 +14,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-use Test::Harness qw(&runtests $verbose);
+use Test::Harness;
use File::Find;
+use Getopt::Long;
use strict;
@@ -31,10 +32,19 @@ unit - Run unit tests in directory
=head1 SYNOPSIS
- unit run
+ unit [--[no]big] [--[no]verbose] run [tests to run]
=cut
+my $big= $ENV{'MYTAP_CONFIG'} eq 'big';
+
+my $result = GetOptions (
+ "big!" => \$big,
+ "verbose!" => \$Test::Harness::verbose,
+);
+
+$ENV{'MYTAP_CONFIG'} = $big ? 'big' : '';
+
my $cmd = shift;
if (defined $cmd && exists $dispatch{$cmd}) {
@@ -55,8 +65,8 @@ sub _find_test_files (@) {
my @dirs = @_;
my @files;
find sub {
- $File::Find::prune = 1 if /^SCCS$/;
- push(@files, $File::Find::name) if -x _ && /-t\z/;
+ $File::Find::prune = 1 if /^(SCCS|\.libs)$/;
+ push(@files, $File::Find::name) if -x _ && (/-t\z/ || /-t\.exe\z/);
}, @dirs;
return @files;
}
@@ -92,8 +102,8 @@ sub run_cmd (@) {
if (@files > 0) {
# Removing the first './' from the file names
foreach (@files) { s!^\./!! }
- $ENV{'HARNESS_PERL_SWITCHES'} .= q" -e 'exec @ARGV'";
+ $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
+ $Test::Harness::Timer = 1;
runtests @files;
}
}
-