[Bps-public-commit] r15330 - in Shipwright/branches/1.10: lib/Shipwright t

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Aug 21 06:04:03 EDT 2008


Author: sunnavy
Date: Thu Aug 21 06:04:01 2008
New Revision: 15330

Modified:
   Shipwright/branches/1.10/lib/Shipwright/Test.pm
   Shipwright/branches/1.10/t/01.repo_check.t
   Shipwright/branches/1.10/t/07.script.t
   Shipwright/branches/1.10/t/10.flags.t
   Shipwright/branches/1.10/t/21.perl_in_build.t
   Shipwright/branches/1.10/t/71.script_cmds.t
   Shipwright/branches/1.10/t/hello/svk.t
   Shipwright/branches/1.10/t/hello/svn.t
   Shipwright/branches/1.10/t/perlcritic.t

Log:
merged 15326:15329 to 1.1

Modified: Shipwright/branches/1.10/lib/Shipwright/Test.pm
==============================================================================
--- Shipwright/branches/1.10/lib/Shipwright/Test.pm	(original)
+++ Shipwright/branches/1.10/lib/Shipwright/Test.pm	Thu Aug 21 06:04:01 2008
@@ -7,6 +7,7 @@
 use File::Temp qw/tempdir/;
 use IPC::Cmd qw/can_run/;
 use File::Spec::Functions qw/catfile catdir/;
+use Shipwright::Util;
 
 our @EXPORT =
   qw/has_svk has_svn create_fs_repo create_svk_repo create_svn_repo devel_cover_enabled test_cmd/;
@@ -21,24 +22,36 @@
 
 =head2 has_svk
 
-check to see if we have svk or not.
-in fact, it also checks svnadmin since we need that to create repo for svk
+check to see if we have svk or not, also limit the svk version to be 2+.
+in fact, it also checks svnadmin since we need that to create repo for svk.
 
 =cut
 
 sub has_svk {
-    return can_run('svk') && can_run('svnadmin');
+    if ( can_run('svk') && can_run('svnadmin') ) {
+        my $out = Shipwright::Util->run(['svk', '--version']);
+        if ( $out =~ /version v(\d)\./ ) {
+            return 1 if $1 >= 2;
+        }
+    }
+    return;
 }
 
 =head2 has_svn
 
-check to see if we have svn or not.
-in fact, it also checks svnadmin since we need that to create repo
+check to see if we have svn or not, also limit the svn version to be 1.4+.
+in fact, it also checks svnadmin since we need that to create repo.
 
 =cut
 
 sub has_svn {
-    return can_run('svn') && can_run('svnadmin');
+    if ( can_run('svn') && can_run('svnadmin') ) {
+        my $out = Shipwright::Util->run(['svn', '--version']);
+        if ( $out =~ /version 1\.(\d)/ ) {
+            return 1 if $1 >= 4;
+        }
+    }
+    return;
 }
 
 =head2 create_fs_repo 

Modified: Shipwright/branches/1.10/t/01.repo_check.t
==============================================================================
--- Shipwright/branches/1.10/t/01.repo_check.t	(original)
+++ Shipwright/branches/1.10/t/01.repo_check.t	Thu Aug 21 06:04:01 2008
@@ -8,6 +8,8 @@
 
 use Test::More tests => 10;
 
+Shipwright::Test->init;
+
 SKIP: {
     skip "no svk found", 5
       unless has_svk();

Modified: Shipwright/branches/1.10/t/07.script.t
==============================================================================
--- Shipwright/branches/1.10/t/07.script.t	(original)
+++ Shipwright/branches/1.10/t/07.script.t	Thu Aug 21 06:04:01 2008
@@ -6,6 +6,7 @@
 use Shipwright::Script;
 use Shipwright;
 use Shipwright::Test;
+Shipwright::Test->init;
 
 is_deeply(
     { del => 'delete', ls => 'list', up => 'update' },

Modified: Shipwright/branches/1.10/t/10.flags.t
==============================================================================
--- Shipwright/branches/1.10/t/10.flags.t	(original)
+++ Shipwright/branches/1.10/t/10.flags.t	Thu Aug 21 06:04:01 2008
@@ -7,6 +7,8 @@
 
 use Test::More tests => 6;
 
+Shipwright::Test->init;
+
 SKIP: {
     skip "no svk and svnadmin found", 3
       unless has_svk();

Modified: Shipwright/branches/1.10/t/21.perl_in_build.t
==============================================================================
--- Shipwright/branches/1.10/t/21.perl_in_build.t	(original)
+++ Shipwright/branches/1.10/t/21.perl_in_build.t	Thu Aug 21 06:04:01 2008
@@ -7,6 +7,7 @@
 use File::Temp qw/tempdir/;
 
 use Test::More tests => 8;
+Shipwright::Test->init;
 
 SKIP: {
     skip "no svk and svnadmin found", 8

Modified: Shipwright/branches/1.10/t/71.script_cmds.t
==============================================================================
--- Shipwright/branches/1.10/t/71.script_cmds.t	(original)
+++ Shipwright/branches/1.10/t/71.script_cmds.t	Thu Aug 21 06:04:01 2008
@@ -63,7 +63,7 @@
         ],
 
         # list cmd
-        [ [ 'list', ], '', "list null $repo" ],
+        [ [ 'list', ], qr/^\s*$/, "list null $repo" ],
         [
             [ 'list', 'foo' ],
             qr/foo doesn't exist/,

Modified: Shipwright/branches/1.10/t/hello/svk.t
==============================================================================
--- Shipwright/branches/1.10/t/hello/svk.t	(original)
+++ Shipwright/branches/1.10/t/hello/svk.t	Thu Aug 21 06:04:01 2008
@@ -10,6 +10,7 @@
 
 use Test::More tests => 41;
 use Shipwright::Test qw/has_svk create_svk_repo/;
+Shipwright::Test->init;
 
 SKIP: {
     skip "no svk and svnadmin found", Test::More->builder->expected_tests

Modified: Shipwright/branches/1.10/t/hello/svn.t
==============================================================================
--- Shipwright/branches/1.10/t/hello/svn.t	(original)
+++ Shipwright/branches/1.10/t/hello/svn.t	Thu Aug 21 06:04:01 2008
@@ -9,6 +9,7 @@
 use Cwd;
 use Test::More tests => 17;
 use Shipwright::Test qw/has_svn create_svn_repo/;
+Shipwright::Test->init;
 
 SKIP: {
     skip "no svn found", Test::More->builder->expected_tests

Modified: Shipwright/branches/1.10/t/perlcritic.t
==============================================================================
--- Shipwright/branches/1.10/t/perlcritic.t	(original)
+++ Shipwright/branches/1.10/t/perlcritic.t	Thu Aug 21 06:04:01 2008
@@ -2,7 +2,8 @@
 use warnings;
 
 use Test::More;
-eval "use Test::Perl::Critic 0.0.8";
-plan skip_all => "Test::Perl::Critic 0.0.8 required for testing PBP compliance" if $@;
+# we forced use Perl::Critic is for version limit
+eval "use Perl::Critic 1.090; use Test::Perl::Critic 1.01";
+plan skip_all => "Perl::Critic 1.090 and Test::Perl::Critic 1.01 required for testing PBP compliance" if $@;
 
 Test::Perl::Critic::all_critic_ok();



More information about the Bps-public-commit mailing list