todomod.pl 832 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/perl
  2. # check and adjust t/modules.t TODO list
  3. use Term::ANSIColor ':constants';
  4. print "press ",RED,"ENTER",RESET," after each module\n";
  5. my $gfail;
  6. for $t (`cat t/top100`) {
  7. chomp $t;
  8. local $Term::ANSIColor::AUTORESET = 1;
  9. local @ARGV = grep !/\.(err|bak)/, "t/modules.t", glob "log.modules-5.0*";
  10. my ($fail,$f,$f1);
  11. while (<>) {
  12. if (!$f or ($f ne $ARGV)) {
  13. $f = $f1 = $ARGV;
  14. $f1 =~ s/log.modules-//;
  15. }
  16. if (/ $t\s/) {
  17. my $reset;
  18. printf "%-20s: ", $f1;
  19. if (/fail / and !/TODO/) {
  20. $reset++; $fail++;
  21. print RED;
  22. }
  23. if (/pass / and /TODO/) {
  24. $reset++;
  25. print GREEN;
  26. }
  27. print $_;
  28. print RESET if $reset;
  29. }
  30. }
  31. print "--\n";
  32. my $enter = <STDIN> if $fail;
  33. $gfail += $fail if $fail;
  34. }
  35. print "$gfail fail\n";