]> git.imager.perl.org - imager.git/commitdiff
also check individual files get version bumps on changes
authorTony Cook <tony@develop-help.com>
Mon, 8 Apr 2013 13:30:21 +0000 (23:30 +1000)
committerTony Cook <tony@develop-help.com>
Mon, 8 Apr 2013 13:30:21 +0000 (23:30 +1000)
t/x90cmpversion.t

index df20b4d65f3eafd447d7f510669b900a0e12180c..202da2a969643da16c58747b3a192ff93179d22f 100644 (file)
@@ -2,6 +2,7 @@
 use strict;
 use Test::More;
 use ExtUtils::MakeMaker;
+use ExtUtils::Manifest 'maniread';
 use File::Spec::Functions qw(devnull);
 
 my $last_tag = `git describe --abbrev=0`;
@@ -10,9 +11,16 @@ chomp $last_tag;
 $last_tag
   or plan skip_all => "Only usable in a git checkout";
 
-my @subdirs = qw(PNG TIFF GIF JPEG W32 T1 FT2);
+my $mani = maniread();
 
-plan tests => scalar(@subdirs);
+my @subdirs = qw(PNG TIFF GIF JPEG W32 T1 FT2 ICO SGI Mandelbrot CountColor DynTest);
+
+my $subdir_re = "^(?:" . join("|", @subdirs) . ")/";
+
+my @pm_files = sort
+  grep /\.pm$/ && !/$subdir_re/ && !/^t\// && $_ ne 'Imager.pm', keys %$mani;
+
+plan tests => scalar(@subdirs) + scalar(@pm_files);
 
 for my $dir (@subdirs) {
   my @changes = `git log --abbrev --oneline $last_tag..HEAD $dir`;
@@ -31,6 +39,22 @@ for my $dir (@subdirs) {
   }
 }
 
+for my $file (@pm_files) {
+  my @changes = `git log --abbrev --oneline $last_tag..HEAD $file`;
+  my @more_changes = `git status --porcelain $file`;
+ SKIP:
+  {
+    @changes || @more_changes
+      or skip "No changes for $file", 1;
+    my $current = eval { MM->parse_version($file) };
+    my $last_rel_content = get_file_from_git($file, $last_tag);
+    my $last = eval { MM->parse_version(\$last_rel_content) };
+    unless (isnt($current, $last, "$file updated, version bump")) {
+      diag(@changes, @more_changes);
+    }
+  }
+}
+
 sub get_file_from_git {
     my ($file, $tag) = @_;
     my $null = devnull();