[Bps-public-commit] Shipwright branch, master, updated. 669ec5e16f2e034eabce69dae06c3f7987f381b3

Ruslan Zakirov ruz at bestpractical.com
Thu Sep 17 02:10:03 EDT 2009


The branch, master has been updated
       via  669ec5e16f2e034eabce69dae06c3f7987f381b3 (commit)
       via  4ddaf50b2872d338dfe434dcc5607fd73c780091 (commit)
      from  597760f605f3b868306e24938fa9329a4f302856 (commit)

Summary of changes:
 bin/shipwright    |    2 +-
 xt/env-coverage.t |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletions(-)
 create mode 100644 xt/env-coverage.t

- Log -----------------------------------------------------------------
commit 4ddaf50b2872d338dfe434dcc5607fd73c780091
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 17 10:08:49 2009 +0400

    test that all ENV variables are documented ENV.pod

diff --git a/xt/env-coverage.t b/xt/env-coverage.t
new file mode 100644
index 0000000..724432d
--- /dev/null
+++ b/xt/env-coverage.t
@@ -0,0 +1,36 @@
+use strict;
+use Test::More;
+use File::Spec::Functions qw/catfile catdir/;
+use File::Basename qw( dirname );
+use autodie;
+
+my $manifest = catdir( dirname(__FILE__), '..', 'MANIFEST' );
+plan skip_all => 'MANIFEST does not exist' unless -e $manifest;
+plan tests => 1;
+
+open my $fh, '<', $manifest;
+my @files = map { chomp; $_ } grep m{^(lib/.*\.pm$|(?:t|xt)/.*\.t$|bin/)}, <$fh>;
+close $fh;
+
+
+my @we_use;
+foreach my $file ( @files ) {
+    open my $fh, '<', $file;
+    push @we_use, (do { local $/; <$fh> } =~ m/\$ENV{['"]?([A-Z_]+)['"]?}/g);
+    close $fh;
+}
+my %seen = map {$_ => 1} qw(PERLLIB PATH); # skip some
+ at we_use = grep !$seen{$_}++, @we_use;
+
+diag "we use: ". join ', ', @we_use
+    if $ENV{'TEST_VERBOSE'};
+
+my $pod = do {
+    open my $fh, '<', 'lib/Shipwright/Manual/ENV.pod';
+    local $/; <$fh>;
+};
+
+my @not_documented = grep $pod !~ /^=item \Q$_\E\b/m, @we_use;
+
+is scalar @not_documented, 0, "all used ENVs are documented"
+    or diag "missing: ". join ', ', @not_documented;

commit 669ec5e16f2e034eabce69dae06c3f7987f381b3
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 17 10:09:28 2009 +0400

    fix typo in ENV variable we're defaulting

diff --git a/bin/shipwright b/bin/shipwright
index e1d4e69..0d67f46 100755
--- a/bin/shipwright
+++ b/bin/shipwright
@@ -14,6 +14,6 @@ $ENV{SHIPWRIGHT_SVK} ||= 'svk';
 $ENV{SHIPWRIGHT_SVN} ||= 'svn';
 $ENV{SHIPWRIGHT_GIT} ||= 'git';
 $ENV{PERL_MM_USE_DEFAULT} ||= 1;
-$ENV{SHIPWRIHGT_LWP_TIMEOUT} ||= 1200;
+$ENV{SHIPWRIGHT_LWP_TIMEOUT} ||= 1200;
 Shipwright::Script->dispatch();
 chdir $cwd;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list