summaryrefslogtreecommitdiff
path: root/t/test.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-06-19 20:34:37 +0200
committerNicholas Clark <nick@ccl4.org>2011-06-22 22:41:15 +0200
commit9c86860c5a5d33ce2b09c38114c6017a4dc29975 (patch)
tree4d8bdca04d0bbddb6701efe48114482ff58a1bce /t/test.pl
parent18388fdbd6a991f0d3b0c3df220014d82e8e4ff4 (diff)
downloadperl-9c86860c5a5d33ce2b09c38114c6017a4dc29975.tar.gz
Add find_git_or_skip(), which skips if we are not in a git checkout.
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 d9b94328f8..c11d0b88f3 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -152,6 +152,13 @@ sub skip_all_without_config {
}
}
+sub find_git_or_skip {
+ return if -d '.git';
+ my $reason = 'not being run from a git checkout';
+ skip_all($reason) if $_[0] && $_[0] eq 'all';
+ skip($reason, @_);
+}
+
sub _ok {
my ($pass, $where, $name, @mess) = @_;
# Do not try to microoptimize by factoring out the "not ".