[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.4.3-161-g2d27e5d



The following commit has been merged in the master branch:
commit 8983d5e3a6f4f4afebc5cf0de1ed494657ccb03b
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Tue Jan 25 21:27:27 2011 -0600

    Speed up minimum-version.t by using multiple threads

diff --git a/t/scripts/minimum-version.t b/t/scripts/minimum-version.t
index 71b9b03..fa009ef 100755
--- a/t/scripts/minimum-version.t
+++ b/t/scripts/minimum-version.t
@@ -1,8 +1,32 @@
 #!/usr/bin/perl -w
 
+use strict;
+use warnings;
+
+# Poor man's attempt to speed up this test:
+# (needs to be loaded before anything else)
+use threads;
+
 use Test::More;
 eval 'use Test::MinimumVersion';
 plan skip_all => 'Test::MinimumVersion required to run this test' if $@;
 
 # sarge was released with 5.8.4, etch with 5.8.8, lenny with 5.10.0
-all_minimum_version_ok('v5.10.0', { paths => [$ENV{'LINTIAN_ROOT'}] });
+our $REQUIRED = 'v5.10.0';
+
+our @PATHS = qw(lib checks collection unpack);
+
+# It creates as many threads as elements in @PATHS
+for my $path (@PATHS) {
+    threads->create(sub {
+	my $p = shift;
+	$p = $ENV{'LINTIAN_ROOT'} . '/' . $p;
+	all_minimum_version_ok($REQUIRED, { paths => [$p] , no_plan => 1});
+    }, $path);
+}
+
+for my $thr (threads->list()) {
+    $thr->join();
+}
+
+done_testing();

-- 
Debian package checker


Reply to: