summaryrefslogtreecommitdiff
path: root/unittest/unit.pl
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-05-05 14:51:01 +0300
committerMichael Widenius <monty@askmonty.org>2011-05-05 14:51:01 +0300
commitd5caa00161453eb0cd61e3641d4e6783fb385319 (patch)
tree34c7e24c19fda340a460e8d5316ca054617c687d /unittest/unit.pl
parenta67a5dd6f956bf6f62799eafa2c67d008ee15e24 (diff)
downloadmariadb-git-d5caa00161453eb0cd61e3641d4e6783fb385319.tar.gz
Improved 'make test-unit' time slightly
storage/maria/unittest/ma_test_loghandler-t.c: Don't sync during test storage/maria/unittest/ma_test_loghandler_multigroup-t.c: Don't sync during test storage/maria/unittest/ma_test_loghandler_multithread-t.c: Don't sync during test unittest/mysys/bitmap-t.c: Don't test all bit combinations (not needed) unittest/mysys/thr_template.c: Remove sleep as old bug should be fixed nowadays unittest/mysys/waiting_threads-t.c: Only run test with --big unittest/mytap/tap.c: Print total time at end of test. unittest/unit.pl: Use TAP::Harness instead of Test::Harness (recommended according to manual) Add times to tests.
Diffstat (limited to 'unittest/unit.pl')
-rw-r--r--unittest/unit.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/unittest/unit.pl b/unittest/unit.pl
index be6424ec798..23ec954f720 100644
--- a/unittest/unit.pl
+++ b/unittest/unit.pl
@@ -14,7 +14,7 @@
# 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;
+use TAP::Harness;
use File::Find;
use Getopt::Long;
@@ -37,10 +37,11 @@ unit - Run unit tests in directory
=cut
my $big= $ENV{'MYTAP_CONFIG'} eq 'big';
+my $verbose= 0;
my $result = GetOptions (
"big!" => \$big,
- "verbose!" => \$Test::Harness::verbose,
+ "verbose!" => \$verbose,
);
$ENV{'MYTAP_CONFIG'} = $big ? 'big' : '';
@@ -102,8 +103,14 @@ sub run_cmd (@) {
if (@files > 0) {
# Removing the first './' from the file names
foreach (@files) { s!^\./!! }
- $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
- runtests @files;
+
+ my %args = (
+ verbosity => $verbose,
+ timer => 1,
+ exec => [ "/bin/sh", "-c" ],
+ );
+ my $harness= TAP::Harness->new( \%args );
+ $harness->runtests(@files);
}
}