diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-19 21:44:37 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-22 22:41:18 +0200 |
commit | 7eccb5a9a1fbf12db8dc44deb2f31e15c934326b (patch) | |
tree | 418aa30d3b29962db15181cc9c50d9a155196d5a /t/test.pl | |
parent | 7cadc1d05427224f84d0bb7974e4f6f348841038 (diff) | |
download | perl-7eccb5a9a1fbf12db8dc44deb2f31e15c934326b.tar.gz |
find_git_or_skip() will now follow symlinks and chdir to the real source tree.
porting{authors,cmp_version,manifest}.t now use TestInit qw(T A) to set @INC
and $^X to absolute paths, in case find_git_or_skip() changes directory.
As $^X is now absolute, there's no need to choose between '/' and '\\' based
on $^O.
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -154,6 +154,18 @@ sub skip_all_without_config { sub find_git_or_skip { return if -d '.git'; + if (-l 'MANIFEST' && -l 'AUTHORS') { + my $where = readlink 'MANIFEST'; + die "Can't readling MANIFEST: $!" unless defined $where; + die "Confusing symlink target for MANIFEST, '$where'" + unless $where =~ s!/MANIFEST\z!!; + if (-d "$where/.git") { + # Looks like we are in a symlink tree + chdir $where or die "Can't chdir '$where': $!"; + note("Found source tree at $where"); + return; + } + } my $reason = 'not being run from a git checkout'; skip_all($reason) if $_[0] && $_[0] eq 'all'; skip($reason, @_); |