source: trunk/UNIT_TESTER/dumpTestLocations.pl

Last change on this file was 18426, checked in by westram, 5 years ago
  • Property svn:executable set to *
File size: 679 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my $reg_test = qr/^\s*\{\s*(TEST_[a-z0-9_]*)\s*,.*\"(.*:[0-9]+)\"/i;
7
8sub 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
21sub 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}
31main();
Note: See TracBrowser for help on using the repository browser.