Commit | Line | Data |
---|---|---|
772ab650 | 1 | #!/usr/bin/perl |
e8d4f2e1 NC |
2 | # Finds the files that have the same name, case insensitively in the build tree |
3 | ||
4 | BEGIN { | |
5 | @INC = '..' if -f '../TestInit.pm'; | |
f986e774 | 6 | require './test.pl'; |
e8d4f2e1 NC |
7 | } |
8 | use TestInit qw(T); # T is chdir to the top level | |
772ab650 JM |
9 | |
10 | use warnings; | |
11 | use strict; | |
12 | use File::Find; | |
13 | ||
14 | my %files; | |
bf61c852 JV |
15 | my $test_count = 0; |
16 | ||
b31a8a8d | 17 | find({no_chdir => 1, wanted => sub { |
5d52f905 RS |
18 | my $name = $File::Find::name; |
19 | # Assumes that the path separator is exactly one character. | |
e8d4f2e1 | 20 | $name =~ s/^\..//; |
f86fc3ff | 21 | |
5d52f905 RS |
22 | # Special exemption for Makefile, makefile |
23 | return if $name =~ m!\A(?:x2p/)?[Mm]akefile\z!; | |
0a38ae18 | 24 | |
94c4b1f7 NC |
25 | if ($name eq '.git') { |
26 | # Don't scan the .git directory, as its contents are outside | |
27 | # our control. In particular, as fetch doesn't default to | |
28 | # --prune, # someone pushing a branch upstream with a name | |
29 | # which case-conflicts with a previously deleted branch will | |
30 | # cause action-at-a-distance failures, because locally | |
31 | # .git/logs/refs/remotes will contain both. | |
32 | ++$File::Find::prune; | |
33 | return; | |
34 | } | |
35 | ||
5d52f905 | 36 | push @{$files{lc $name}}, $name; |
b31a8a8d | 37 | }}, '.'); |
772ab650 | 38 | |
0f7807cd | 39 | foreach (sort values %files) { |
f986e774 CK |
40 | is( @$_, 1, join(", ", @$_) ) or |
41 | do{ note($_) foreach @$_; }; | |
772ab650 JM |
42 | } |
43 | ||
f986e774 | 44 | done_testing(); |