summaryrefslogtreecommitdiff
path: root/t/whitespace.t
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-09-14 11:32:26 -0700
committerDustin Sallings <dustin@spy.net>2009-09-14 11:32:26 -0700
commit071cf9f9776b30386de652d27417d475cf2b69c5 (patch)
treec897cd5ca1af7766678a095b914302ad9d4d568d /t/whitespace.t
parentad060b8a46fad4a5411ff4b7fb0fa72b43ff14b0 (diff)
downloadmemcached-071cf9f9776b30386de652d27417d475cf2b69c5.tar.gz
New whitespace test.
Using git (when available) to figure out what should be tested.
Diffstat (limited to 't/whitespace.t')
-rwxr-xr-xt/whitespace.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/t/whitespace.t b/t/whitespace.t
index d2f5228..8f97cb9 100755
--- a/t/whitespace.t
+++ b/t/whitespace.t
@@ -5,9 +5,24 @@ our @files;
BEGIN {
chdir "$Bin/.." or die;
- @files = grep {! /^config.h$/ } (glob("*.h"), glob("*.c"), glob("*.ac"),
- "memcached.spec.in");
+
+ my @exempted = qw(Makefile.am ChangeLog);
+ my %exempted_hash = map { $_ => 1 } @exempted;
+
+ my @stuff = split /\0/, `git ls-tree -z --name-only HEAD`;
+ @files = grep { -f $_ && ! $exempted_hash{$_} } @stuff;
+
+ # We won't find any files if git isn't installed. If git isn't
+ # installed, they're probably not doing any useful development, or
+ # at the very least am will clean up whitespace when we receive
+ # their patch.
+ unless (@files) {
+ use Test::More;
+ plan skip_all => "Skipping tests probably because you don't have git.";
+ exit 0;
+ }
}
+
use Test::More tests => scalar(@files);
foreach my $f (@files) {