File: filter_tests.pl

package info (click to toggle)
libooc-xml 3.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,880 kB
  • ctags: 360
  • sloc: xml: 10,312; ansic: 1,681; sh: 798; makefile: 301; perl: 17
file content (20 lines) | stat: -rwxr-xr-x 432 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w

use strict;

$/=undef;
my $file=<>;
my %tests=();
while ($file =~ m:(<test.*?</test>):imsg) {
  my $elem = $1;
  my ($type) = $elem =~ m:type\s*=\s*['"]([^'"]*)['"]:i;
  my ($uri) = $elem =~ m:uri\s*=\s*['"]([^'"]*)['"]:i;
  push @{$tests{$type}}, $uri;
}
for my $i (keys %tests) {
  my $fname = "$i.list";
  print "Writing $fname\n";
  open F, ">$fname";
  print F join("\n", @{$tests{$i}}), "\n";
  close F;
}