Revert "daemon: check connections WIP"
[public-inbox.git] / xt / check-debris.t
blob0bb5091d8899c62cf416a46ebc5e768298dee877
1 #!perl -w
2 use v5.12;
3 use autodie qw(open);
4 use PublicInbox::TestCommon;
5 use File::Spec;
6 my $tmpdir = File::Spec->tmpdir;
8 diag "note: writes to `$tmpdir' by others results in false-positives";
10 my %cur = map { $_ => 1 } glob("$tmpdir/*");
11 for my $t (@ARGV ? @ARGV : glob('t/*.t')) {
12         open my $fh, '-|', $^X, '-w', $t;
13         my @out;
14         while (<$fh>) {
15                 chomp;
16                 push @out, $_;
17                 next if /^ok / || /\A[0-9]+\.\.[0-9]+\z/;
18                 diag $_;
19         }
20         ok(close($fh), $t) or diag(explain(\@out));
22         no_coredump($tmpdir);
24         my @remain = grep { !$cur{$_}++ } glob("$tmpdir/*");
25         next if !@remain;
26         is_deeply(\@remain, [], "$t has no leftovers") or
27                 diag "$t added: ",explain(\@remain);
30 done_testing;