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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sat Oct 16 13:34:56 2004 UTC (20 years, 1 month ago) by wakaba
Branch: MAIN
Changes since 1.1: +4 -1 lines
File MIME type: text/plain
New DISDOC elements introduced

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     GetOptions (
9     'test-directory=s' => \$dir,
10     'test-file-pattern=s' => \$file_pattern,
11     'output-directory=s' => \$out_dir,
12     );
13     $dir or die "$0: test-directory must be specified";
14     $out_dir or die "$0: output-directory must be specified";
15     $file_pattern ||= qr/\.xml$/;
16    
17     opendir my $dirh, $dir or die "$0: $dir: $!";
18     for (grep {$_ ne 'alltests.xml'} grep /$file_pattern/, readdir $dirh) {
19 wakaba 1.2 my $out_file = $out_dir.'/'.$_.'.pl';
20 wakaba 1.1 my @cmd = ('perl', map ({"-I$_"} @INC),
21     'domtest2perl.pl', $dir.'/'.$_,
22 wakaba 1.2 '--output-file' => $out_file);
23 wakaba 1.1 print STDERR join " ", @cmd, "\n";
24     system @cmd and die "$0: domtest2perl.pl: $@";
25 wakaba 1.2 system 'perl', map ({"-I$_"} @INC), '-c', $out_file
26     and die "$0: $out_file: $@";
27 wakaba 1.1 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24