Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | |
---|
6 | my $reg_test = qr/^\s*\{\s*(TEST_[a-z0-9_]*)\s*,.*\"(.*:[0-9]+)\"/i; |
---|
7 | |
---|
8 | sub scanModule($) { |
---|
9 | my ($module) = @_; |
---|
10 | open(IN, '<'.$module) || die "cannot read '$module' (Reason: $!)"; |
---|
11 | my $line; |
---|
12 | while (defined ($line=<IN>)) { |
---|
13 | if ($line =~ $reg_test) { |
---|
14 | my ($tname,$tloc) = ($1,$2); |
---|
15 | print "$tloc: Found test $tname in untested unit\n"; |
---|
16 | } |
---|
17 | } |
---|
18 | close(IN); |
---|
19 | } |
---|
20 | |
---|
21 | sub main() { |
---|
22 | my $args = scalar(@ARGV); |
---|
23 | if ($args==1) { |
---|
24 | scanModule($ARGV[0]); |
---|
25 | } |
---|
26 | else { |
---|
27 | print "Usage: dumpTestLocations.pl testmodule.cxx\n"; |
---|
28 | print "dumps locations of tests contained in testmodule.cxx as messages to STDOUT\n"; |
---|
29 | } |
---|
30 | } |
---|
31 | main(); |
---|
Note: See
TracBrowser
for help on using the repository browser.