Added t/porting/dual-life.t
authorDavid Golden <dagolden@cpan.org>
Mon, 19 Jul 2010 00:51:30 +0000 (20:51 -0400)
committerDavid Golden <dagolden@cpan.org>
Mon, 19 Jul 2010 00:51:30 +0000 (20:51 -0400)
Because we manually generate Makefiles, any executables need to be
generated from .PL files in utils/.  This test checks if dual-life
executables show up in utils/.

t/porting/dual-life.t [new file with mode: 0644]

diff --git a/t/porting/dual-life.t b/t/porting/dual-life.t
new file mode 100644 (file)
index 0000000..cf3c337
--- /dev/null
@@ -0,0 +1,29 @@
+#!/perl -w
+use strict;
+
+# This tests properties of dual-life modules:
+#
+# * Are all dual-life programs being generated in utils/?
+
+use File::Basename;
+use File::Find;
+use File::Spec::Functions;
+use Test::More; END { done_testing }
+
+my @programs;
+
+find(
+  sub {
+    my $name = $File::Find::name;
+    return if $name =~ /blib/;
+    return unless $name =~ m{/(?:bin|scripts?)/\S+\z};
+
+    push @programs, $name;
+  }, 
+  qw( ../cpan ../dist ../ext ),
+);
+
+for my $f ( @programs ) {
+  ok( -f catfile('..', 'utils', basename($f)), "$f" );
+}
+