diff options
author | Marc Alff <marc.alff@sun.com> | 2009-11-17 21:29:26 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-11-17 21:29:26 -0700 |
commit | 48ea0b83a0a19b2107df4300bda211206b37ea20 (patch) | |
tree | 82ff91bb12c9ad25f14d3ff86735d39d819703bb /unittest/unit.pl | |
parent | 244eced1a797f15dd0ebe0a58b6c054c26b4fa28 (diff) | |
download | mariadb-git-48ea0b83a0a19b2107df4300bda211206b37ea20.tar.gz |
Port the unit test framework to windows
Backport from 6.0.14 to 5.6.0
Original code from Guilhem Bichot
Diffstat (limited to 'unittest/unit.pl')
-rw-r--r-- | unittest/unit.pl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/unittest/unit.pl b/unittest/unit.pl index 9d328985012..a1aab376fdf 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}) { @@ -56,7 +66,7 @@ sub _find_test_files (@) { my @files; find sub { $File::Find::prune = 1 if /^SCCS$/; - push(@files, $File::Find::name) if -x _ && /-t\z/; + push(@files, $File::Find::name) if -x _ && (/-t\z/ || /-t\.exe\z/); }, @dirs; return @files; } @@ -92,7 +102,7 @@ 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"'; runtests @files; } } |