summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorDennis Kaarsemaker <dennis@kaarsemaker.net>2013-11-10 23:17:38 +0100
committerTony Cook <tony@develop-help.com>2013-12-16 15:25:22 +1100
commit6b44ec6808e2eea9951ccf5c3e5ec4ed5bdbc0ba (patch)
tree05079cd0708d6fe01cf588f06353f079903fe4be /t/test.pl
parentc260629609c130544b7b1f0ca490292d084319bc (diff)
downloadperl-6b44ec6808e2eea9951ccf5c3e5ec4ed5bdbc0ba.tar.gz
Make tests work with detached git dir
In my jenkins replacement, I run all tests with .git outside the work tree, pointed to by $GIT_DIR. This is fairly common git practice, so let's make the testsuite support this and run the relevant porting tests that are skipped without this patch.
Diffstat (limited to 't/test.pl')
-rw-r--r--t/test.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/test.pl b/t/test.pl
index 5b1ee18fda..fcab07aec1 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -176,6 +176,13 @@ sub find_git_or_skip {
}
$source_dir = $where;
}
+ } elsif (exists $ENV{GIT_DIR}) {
+ my $commit = '8d063cd8450e59ea1c611a2f4f5a21059a2804f1';
+ my $out = `git rev-parse --verify --quiet '$commit^{commit}'`;
+ chomp $out;
+ if($out eq $commit) {
+ $source_dir = '.'
+ }
}
if ($source_dir) {
my $version_string = `git --version`;