complete-run.pl: implement --help

This commit is contained in:
Michael Stapelberg 2011-11-07 21:21:51 +00:00
parent fdf7b1706c
commit 0615cb3595
1 changed files with 39 additions and 0 deletions

View File

@ -13,6 +13,7 @@ use strict;
use warnings; use warnings;
use v5.10; use v5.10;
# the following are modules which ship with Perl (>= 5.10): # the following are modules which ship with Perl (>= 5.10):
use Pod::Usage;
use Carp::Always; use Carp::Always;
use Cwd qw(abs_path); use Cwd qw(abs_path);
use File::Basename qw(basename); use File::Basename qw(basename);
@ -52,14 +53,18 @@ sub slurp {
my $coverage_testing = 0; my $coverage_testing = 0;
my $valgrind = 0; my $valgrind = 0;
my $help = 0;
my @displays = (); my @displays = ();
my $result = GetOptions( my $result = GetOptions(
"coverage-testing" => \$coverage_testing, "coverage-testing" => \$coverage_testing,
"valgrind" => \$valgrind, "valgrind" => \$valgrind,
"display=s" => \@displays, "display=s" => \@displays,
"help|?" => \$help,
); );
pod2usage(0) if $help;
@displays = split(/,/, join(',', @displays)); @displays = split(/,/, join(',', @displays));
@displays = map { s/ //g; $_ } @displays; @displays = map { s/ //g; $_ } @displays;
@ -268,3 +273,37 @@ for (@done) {
# 4: print summary # 4: print summary
$harness->summary($aggregator); $harness->summary($aggregator);
__END__
=head1 NAME
complete-run.pl - Run the i3 testsuite
=head1 SYNOPSIS
complete-run.pl [files...]
=head1 OPTIONS
=over 8
=item B<--display>
Specifies which X11 display should be used. Can be specified multiple times and
will parallelize the tests:
# Run tests on the second X server
./complete-run.pl -d :1
# Run four tests in parallel on some Xdummy servers
./complete-run.pl -d :1,:2,:3,:4
=item B<--valgrind>
Runs i3 under valgrind to find memory problems. The output will be available in
C<latest/valgrind.log>.
=item B<--coverage-testing>
Exits i3 cleanly (instead of kill -9) to make coverage testing work properly.