tagged release 0.7.1
[parrot.git] / languages / perl6 / tools / update_passing_test_data.pl
blob657a451fb891dfa000d3d7adf84d3203314eea39
1 #! perl
2 # Copyright (C) 2001-2008, The Perl Foundation.
3 # $Id$
4 use strict;
5 use warnings;
7 # this ugly piece of perl 5 code runs 'make spectest' and looks
8 # for passing test files that are not yet included in the
9 # 'spectest_regression' target. The output is an evil mess, but still useful.
11 my $test_file = $ARGV[0] || 't/spectest_regression.data';
13 open my $f, '<', $test_file
14 or die "Can't open file '$test_file' for reading: $!";
16 my %known_tests;
17 while (<$f>){
18 chomp;
19 next if m/^\s*(?:#|$)/;
20 # ignore end-of-line comments
21 s/\s+#.*$//g;
22 $known_tests{$_}++;
24 close $f;
26 print "Running the test suite";
27 $| = 1;
29 my @new;
31 open my $t, 'make spectest 2>&1 |'
32 or die "Can't run make: $!";
34 while(<$t>){
35 # hack until the looping parse is fixed
36 unlink glob 't/spec/S29-conversions/ord_and_chr.*';
37 print '.';
38 if (m{^t/spec/(.*?)\.+ok$}){
39 my $test = $1 . '.t';
40 if (!$known_tests{$test}){
41 push @new, $test;
42 print "\n<< new: $test>>\n";
46 close $t;
47 if (@new){
48 print "\nNewly passing tests:\n";
49 print "$_\n" for @new;
52 # Local Variables:
53 # mode: cperl
54 # cperl-indent-level: 4
55 # fill-column: 100
56 # End:
57 # vim: expandtab shiftwidth=4: