|
|
Author: chromatic
Date: Sun Mar 16 00:09:31 2008
New Revision: 26406
Modified:
trunk/CREDITS
trunk/lib/Parrot/Distribution.pm
trunk/t/perl/Parrot_IO.t
Log:
[t] Improved git detection to skip tests that rely on the presence of
Subversion artifacts (Josh McAdams, RT #50966).
Modified: trunk/CREDITS
==============================================================================
--- trunk/CREDITS (original)
+++ trunk/CREDITS Sun Mar 16 00:09:31 2008
@@ -649,3 +649,6 @@
N: Mark Grimes
E: mgrimes@xxxxxxxx
D: Clean up some tests
+
+N: Josh McAdams
+D: Allow git checkouts to pass some tests that require an svn checkout
Modified: trunk/lib/Parrot/Distribution.pm
==============================================================================
--- trunk/lib/Parrot/Distribution.pm (original)
+++ trunk/lib/Parrot/Distribution.pm Sun Mar 16 00:09:31 2008
@@ -130,6 +130,10 @@
=over 4
+=item C<is_svn_co()>
+
+=item C<is_git_co()>
+
=item C<c_source_file_directories()>
=item C<c_header_file_directories()>
@@ -276,6 +280,26 @@
}
}
+=item C<is_svn_co()>
+
+Returns true if this is a subversion checkout of Parrot.
+
+=cut
+
+sub is_svn_co {
+ return shift->directory_exists_with_name('.svn');
+}
+
+=item C<is_git_co()>
+
+Returns true if this is a git checkout of Parrot.
+
+=cut
+
+sub is_git_co {
+ return shift->directory_exists_with_name('.git');
+}
+
=item C<get_c_language_files()>
Returns the C language source files within Parrot. Namely:
Modified: trunk/t/perl/Parrot_IO.t
==============================================================================
--- trunk/t/perl/Parrot_IO.t (original)
+++ trunk/t/perl/Parrot_IO.t Sun Mar 16 00:09:31 2008
@@ -5,8 +5,11 @@
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
+
use Test::More 'tests' => 58;
-use File::Spec::Functions qw(:ALL);
+
+use Parrot::Distribution;
+use File::Spec::Functions ':ALL';
=head1 NAME
@@ -162,7 +165,7 @@
my $nul = File::Spec->devnull;
skip( 'git-svn does not expand keywords', 2 )
- if my @git_svn_info = qx/git svn log --limit=1 2>$nul/ and $? == 0;
+ if Parrot::Distribution->new->is_svn_co();
$f = Parrot::IO::File->new( catfile( 'lib', 'Parrot', 'IO', 'File.pm' ) );
ok( $f->has_svn_id(), 'has_svn_id' );
|
|