/[suikacvs]/messaging/manakai/bin/domts2perl.pl
Suika

Contents of /messaging/manakai/bin/domts2perl.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Oct 31 12:29:00 2004 UTC (20 years ago) by wakaba
Branch: MAIN
CVS Tags: before-dis2-200411
Changes since 1.2: +10 -3 lines
File MIME type: text/plain
More DOMTS elements support

1 wakaba 1.1 #!/usr/bin/perl -w
2     use strict;
3    
4     use Getopt::Long;
5     my $dir;
6     my $out_dir;
7     my $file_pattern;
8 wakaba 1.3 my $domtest2perl = 'domtest2perl.pl';
9 wakaba 1.1 GetOptions (
10 wakaba 1.3 'domtest2perl-path=s' => \$domtest2perl,
11 wakaba 1.1 'test-directory=s' => \$dir,
12     'test-file-pattern=s' => \$file_pattern,
13     'output-directory=s' => \$out_dir,
14 wakaba 1.3 ) or die;
15 wakaba 1.1 $dir or die "$0: test-directory must be specified";
16     $out_dir or die "$0: output-directory must be specified";
17     $file_pattern ||= qr/\.xml$/;
18    
19     opendir my $dirh, $dir or die "$0: $dir: $!";
20     for (grep {$_ ne 'alltests.xml'} grep /$file_pattern/, readdir $dirh) {
21 wakaba 1.3 my $in_file = $dir.'/'.$_;
22 wakaba 1.2 my $out_file = $out_dir.'/'.$_.'.pl';
23 wakaba 1.3 if (-e $out_file and -C $in_file >= -C $out_file) {
24     warn "$0: $_.pl: Skipped; it is newer than $_";
25     next;
26     }
27 wakaba 1.1 my @cmd = ('perl', map ({"-I$_"} @INC),
28 wakaba 1.3 $domtest2perl, $in_file,
29 wakaba 1.2 '--output-file' => $out_file);
30 wakaba 1.1 print STDERR join " ", @cmd, "\n";
31 wakaba 1.3 system @cmd and die "$0: $domtest2perl: $@";
32 wakaba 1.2 system 'perl', map ({"-I$_"} @INC), '-c', $out_file
33     and die "$0: $out_file: $@";
34 wakaba 1.1 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24