File: TestLister.pl

package info (click to toggle)
libtest-unit-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,312 kB
  • sloc: perl: 4,297; makefile: 5
file content (27 lines) | stat: -rwxr-xr-x 498 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl -w

use strict;

use Getopt::Long;
use Test::Unit::Loader;

my %opts = ();
GetOptions(\%opts, 'help', 'testcases');
usage() if $opts{help};

foreach my $test (@ARGV) {
    my $suite = Test::Unit::Loader::load($test);
    print join '', @{ $suite->list($opts{testcases}) };
}
 
sub usage {
    die <<EOF;
Usage: $0 [ OPTIONS ] <TEST> [ <TEST> ... ]

Options:
   --testcases, -t   List testcases contained in (sub)suites
   --help, -h

Tests can be package names or file names.
EOF
}