bump version
[gitmo/Moo.git] / xt / test-my-dependents.t
index b7efc66..e93f174 100644 (file)
@@ -1,6 +1,6 @@
 use Test::More;
 BEGIN {
-  plan skip_all => <<'END_HELP' unless $ENV{MOO_TEST_MD};
+  plan skip_all => <<'END_HELP' unless $ENV{MOO_TEST_MD} || @ARGV;
 This test will not run unless you set MOO_TEST_MD to a true value.
 
   Valid values are:
@@ -68,7 +68,7 @@ for my $line (<DATA>) {
   my ( $dist, $reason ) = $line =~ /^(\S*)\s*(?:#\s*(.*?)\s*)?$/;
   next unless defined $dist && length $dist;
 
-  $hash->{$dist} = $reason || $sec_reason;
+  $hash->{$dist} = $reason ? "$sec_reason: $reason" : $reason;
 }
 
 my %todo_module;
@@ -81,10 +81,10 @@ for my $hit (@{ $res->{hits}{hits} }) {
     if $dist =~ /^(?:Task|Bundle|Acme)-/;
 
   my $module = (sort { length $a <=> length $b || $a cmp $b } do {
-    if (my $provides = $_->{fields}{provides}) {
+    if (my $provides = $hit->{fields}{provides}) {
       ref $provides ? @$provides : ($provides);
     }
-    elsif (my $provides = $_->{fields}{'metadata.provides'}) {
+    elsif (my $provides = $hit->{fields}{'metadata.provides'}) {
       keys %$provides;
     }
     else {
@@ -99,26 +99,31 @@ for my $hit (@{ $res->{hits}{hits} }) {
 }
 @modules = sort @modules;
 
-if ( $ENV{MOO_TEST_MD} eq 'MooX' ) {
+my @args = grep { $_ ne '--show' } @ARGV;
+my $show = @args != @ARGV;
+my $pick = $ENV{MOO_TEST_MD} || shift @args || 'all';
+
+if ( $pick eq 'MooX' ) {
   @modules = grep /^MooX(?:$|::)/, @modules;
 }
-elsif ( $ENV{MOO_TEST_MD} eq '1' ) {
-  diag(<<'EOF');
-  Picking 200 random dependents to test. Set MOO_TEST_MD=all to test all
+elsif ( $pick =~ /^\d+$/ ) {
+  my $count = $pick == 1 ? 200 : $pick;
+  diag(<<"EOF");
+  Picking $count random dependents to test. Set MOO_TEST_MD=all to test all
   dependents or MOO_TEST_MD=MooX to test extension modules only.
 EOF
-  @modules = (List::Util::shuffle(@modules))[0..199];
+  @modules = (List::Util::shuffle(@modules))[0 .. $count-1];
 }
-elsif ( $ENV{MOO_TEST_MD} ne 'all' ) {
+elsif ( $pick ne 'all' ) {
   my @chosen = split /,/, $ENV{MOO_TEST_MD};
   my %modules = map { $_ => 1 } @modules;
   if (my @unknown = grep { !$modules{$_} } @chosen) {
-      die "Unknown modules: @unknown";
+    die "Unknown modules: @unknown";
   }
   @modules = @chosen;
 }
 
-if (grep { $_ eq '--show' } @ARGV) {
+if ($show) {
   print "Dependents:\n";
   print "  $_\n" for @modules;
   exit;
@@ -134,47 +139,67 @@ for my $module (@modules) {
 
 __DATA__
 
-# SKIP: no tests
-CPAN-Mirror-Finder
-Catmandu-AlephX
-Device-Hue
-Novel-Robot
-Novel-Robot-Browser
-Novel-Robot-Parser
-Thrift-API-HiveClient
-Tiezi-Robot-Parser
-
-# SKIP: broken
+# TODO: broken
 App-Presto
-Catmandu-Store-Lucy
 Dancer2-Session-Sereal
-Data-Localize
-HTML-Zoom-Parser-HH5P
+Dancer-Plugin-FontSubset
+Mail-GcalReminder       # 0.1
+MooX-LvalueAttribute    # 0.12
+Net-Docker              # 0.002003
+DBIx-Class-IndexSearch-Dezi
 Message-Passing-ZeroMQ
 Tak
 
-# SKIP: broken tests
-Template-Flute
-Uninets-Check-Modules-HTTP
-Uninets-Check-Modules-MongoDB
-Uninets-Check-Modules-Redis
-
-# SKIP: missing prereqs
-Catmandu-Z3950
-Tiezi-Robot
-
-# SKIP: bad prereq version listed
-Dancer2-Session-Cookie
-Dancer2-Session-JSON
-
-# TODO: broken, pending release
-Hg-Lib
-P9Y-ProcessTable
-GeoIP2
-
-# SKIP: OS specific
-Linux-AtaSmart
+# TODO: broken by perl 5.18
+App-DBCritic                # 0.020 - smartmatch
+App-OS-Detect-MachineCores  # 0.038 - smartmatch
+Authen-HTTP-Signature       # 0.02 - smartmatch
+DBICx-Backend-Move          # 1.000010 - smartmatch
+Ruby-VersionManager         # 0.004003 - smartmatch
+Text-Keywords               # 0.900 - smartmatch
+HTML-Zoom-Parser-HH5P       # 0.002
+Log-Message-Structured-Stringify-AsSereal   # 0.10
+Text-CSV-Merge              # 0.03 - smartmatch
+
+# TODO: broken prereqs (perl 5.18)
+App-Rssfilter   # 0.03 - Data::Alias
+Data-Sah        # 0.15 - Regexp::Grammars
+Finance-Bank-ID-BCA     # 0.26 - Perinci::CmdLine
+Language-Expr   # 0.19 - Regexp::Grammars
+Net-Icecast2    # 0.005 - PHP::HTTPBuildQuery (hash order)
+Org-To-HTML     # 0.07 - Language::Expr
+POE-Component-ProcTerminator          # 0.03 - Log::Fu
+Perinci-Access-Simple-Server          # 0.12 - Regexp::Grammars
+Perinci-CmdLine                       # 0.85 - Data::Sah
+Perinci-To-Text                       # 0.22 - Data::Sah
+Perinci-Sub-To-Text                   # 0.24 - Data::Sah
+Software-Release-Watch                # 0.01 - Data::Sah, Perinci::CmdLine
+Software-Release-Watch-SW-wordpress   # 0.01 - Software::Release::Watch
+WebService-HabitRPG                   # 0.19 - Data::Alias
+
+# TODO: broken tests
+Net-OAuth-LP # pod coverage
+
+# SKIP: invalid prereqs
+Catmandu-Z3950        # 0.03 - ZOOM missing
+Dancer2-Session-JSON  # 0.001 - Dancer2 bad version requirement
+
+# SKIP: misc
+GeoIP2            # 0.040000 - prereq Math::Int128 (requires gcc 4.4)
+Graphics-Potrace  # 0.72 - external dependency
+GraphViz2         # 2.19 - external dependency
+Linux-AtaSmart    # OS specific
+MaxMind-DB-Reader # 0.040003 - prereq Math::Int128 (requires gcc 4.4)
+MaxMind-DB-Common # 0.031002 - prereq Math::Int128 (requires gcc 4.4)
+Net-Works         # 0.12 - prereq Math::Int128 (requires gcc 4.4)
+PortageXS         # 0.3.1 - external dependency and broken prereq (Shell::EnvImporter)
+XML-GrammarBase   # v0.2.2 - prereq XML::LibXSLT (hard to install)
+Forecast-IO       # 0.21 - interactive tests
+Net-OpenVPN-Launcher    # 0.1 - external dependency (and broken test)
+App-PerlWatcher-Level   # 0.13 - depends on Linux::Inotify2
+Graph-Easy-Marpa        # 2.00 - GraphVis2
 
 # TODO: broken by Moo change
 Math-Rational-Approx        # RT#84035
 App-Services                # RT#85255
+Hg-Lib                      # pending release