From: Dave Rolsky Date: Sat, 21 Apr 2012 15:37:14 +0000 (-0500) Subject: Test 200 random dependents unless MOOSE_TEST_MD eq 'all' X-Git-Tag: 2.0502~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=916fcb5cd6b76e63a6c1b745d6dec3d95bdb1a5e;p=gitmo%2FMoose.git Test 200 random dependents unless MOOSE_TEST_MD eq 'all' --- diff --git a/xt/author/test-my-dependents.t b/xt/author/test-my-dependents.t index 480b3d5..4413f6f 100644 --- a/xt/author/test-my-dependents.t +++ b/xt/author/test-my-dependents.t @@ -120,12 +120,26 @@ my %name_fix = ( 'X11-XCB' => 'X11::XCB::Connection', 'XML-Ant-BuildFile' => 'XML::Ant::BuildFile::Project', ); + my @dists = sort grep { !$skip{$_} } grep { my $dist = $_; !any { $dist =~ /^$_-/ } @skip_prefix } map { $_->{fields}{distribution} } @{ $res->{hits}{hits} }; +unless ( $ENV{MOOSE_TEST_MD} eq 'all' ) { + diag( + 'Picking 200 random dependents to test. Set MOOSE_TEST_MD=all to test all dependents' + ); + + my %indexes; + while ( keys %indexes < 200 ) { + $indexes{ int rand( scalar @dists ) } = 1; + } + + @dists = @dists[ sort keys %indexes ]; +} + plan tests => scalar @dists; for my $dist (@dists) { note($dist);