File: driver

package info (click to toggle)
ps-watcher 1.08-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: sh: 2,907; perl: 1,281; makefile: 104
file content (48 lines) | stat: -rwxr-xr-x 790 bytes parent folder | download | duplicates (11)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl -w
#$Id: driver,v 1.1 2000/03/27 01:53:24 rocky Exp $
use strict;

use File::Basename;
my $program = basename($0); # Who am I today, anyway? 

sub usage {
  print "
usage: 

   $program [test1 ... ] 
   $program --help

Runs regresion tests (via Test::Harness). 

If no tests are specified all tests that match *.t in the
test directory are run. 

$program --help prints this help.
";

  exit 100;
}

use Test::Harness qw(&runtests $verbose);

my $setup = 0;
process_options();

@ARGV = glob("*.t") if !@ARGV;
runtests @ARGV;
exit 0;

# The bane of programming.
sub process_options {
  use Getopt::Long;
  $Getopt::Long::autoabbrev = 1;
  my $help = 0;
  
  my $result = &GetOptions
    (
     'help'           => \$help,
    );
  usage unless $result;
  usage if $help;
}