mock 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/perl
  2. # for p in perl$perlall; do perl$p t/mock --logdir=t/reports/1.28/r584 t/*.t; done
  3. #
  4. # Replay results from stored log files to test the result of the
  5. # current TODO status.
  6. #
  7. # Currently perl compiler tests are stored in two formats:
  8. #
  9. # 1. log.test-$arch-$perlversion
  10. #
  11. # 2. log.modules-$perlversion
  12. #
  13. # When running the Mock tests the actual tests are not executed,
  14. # instead the results from log file are used instead for the result of ok.
  15. # A typical perl-compiler testrun lasts several hours, with Mock
  16. # several seconds.
  17. use strict;
  18. BEGIN {
  19. unshift @INC, 't';
  20. }
  21. use Mock;
  22. use modules;
  23. my $X = $^X =~ m/\s/ ? qq{"$^X"} : $^X;
  24. unless (eval "require Test::Harness::Straps;") {
  25. print "Installing Test::Harness::Straps via cpan...\n";
  26. system("$X -S cpan Test::Harness::Straps");
  27. }
  28. my ($logdir) = grep /--logdir=(.+)/, @ARGV;
  29. my ($arch) = grep /--arch=(.+)/, @ARGV;
  30. $logdir = "." unless $logdir;
  31. my @mod = find_modules_report($logdir);
  32. my @tst = find_test_report($logdir, $arch);
  33. my @tests = @ARGV ? @ARGV : glob "t/*.t";
  34. for my $test (@tests) {
  35. my $version = perlversion;
  36. my @files = $test =~ /modules\.t/ ? @mod : @tst;
  37. @files = () if $test =~ /issue34\.t/; # ignore handmade test
  38. @files = () if $test =~ /bytecode\.t/; # XXX make it into a sub from test.pl
  39. for my $log (@files) {
  40. #my $rpt = parse_report($_);
  41. # XXX run mock test and use result
  42. mock_harness($log, $test);
  43. }
  44. }