Update the test list.
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / soak
CommitLineData
0a7c7f4f 1
2use strict ;
3
4my $verbose = 0 ;
5
6# find all version of Perl that are available
7my @PerlBinaries = qw(
8 perl5.004
9 perl5.00401
10 perl5.00402
11 perl5.00403
12 perl5.00404
13 perl5.00405
14 perl5.005
15 perl5.00501
16 perl5.00502
17 perl5.00503
18 perl5.6.0
19 perl5.6.1
20 perl5.7.0
21 perl5.7.1
22 perl5.7.2
23 );
24
25my $maxlen = 0 ;
26foreach (@PerlBinaries)
27 { $maxlen = length $_ if length $_ > $maxlen }
28$maxlen += 3 ;
29
30# run each through the test harness
31
32my $bad = 0 ;
33my $good = 0 ;
34my $total = 0 ;
35
36foreach my $perl (@PerlBinaries)
37{
38 print "Testing $perl " . ('.' x ($maxlen - length $perl)) ;
39 my $ok = runit("$perl Makefile.PL") &&
40 runit("make sweep") &&
41 runit("make test") ;
42
43 ++ $total;
44 if ($ok) {
45 ++ $good ;
46 print "ok\n";
47 }
48 else {
49 ++ $bad ;
50 print "not ok\n" ;
51 }
52
53}
54
55print "\n\nPassed with $good of $total versions of Perl.\n";
56exit $bad ;
57
58
59sub runit
60{
61 my $cmd = shift ;
62 print "Running [$cmd]\n" if $verbose ;
63 my $file = "/tmp/abc.$$" ;
64 unlink $file ;
65 system "$cmd >$file 2>&1" ;
66 if ($?)
67 {
68 return 0 unless $verbose ;
69 my $output = docat_del($file) ;
70 warn "$cmd failed: $?\n$output\n" ;
71 exit ;
72 }
73 unlink $file ;
74 return 1 ;
75}
76
77sub docat_del
78{
79 my $file = shift;
80 local $/ = undef;
81 open(CAT, "<$file") || die "Cannot open $file: $!";
82 my $result = <CAT>;
83 close(CAT);
84 unlink $file ;
85 return $result;
86}