#!perl -w # $Id: wt,v 1.5 2003/01/07 22:05:32 m_ilya Exp $ =head1 NAME wt - test one or more web pages =head1 SYNOPSIS wt [options] [WTSCRIPT ...] Options: -?, --help brief help message --man full documentation -V, --version version number =head1 OPTIONS =over 4 =item B<-?> =item B<--help> Print a brief help message and exits. =item B<--man> Prints the manual page and exits. =item B<-V> =item B<--version> Prints version number of L and exits. =back =head1 DESCRIPTION This program runs tests using Perl module L on web pages containing Perl/JSP/HTML/JavaScript/etc. and generates a detailed test report. This program expects given input file(s) to be in format of wtscript file. If no files are given then it expects test specification to be passed via standard input. See docs mentioned in section L for full documentation. =head1 EXIT STATUS =over 4 =item * 0 All tests ran successfully. =item * 1 One or more tests failed, there was an error in the input parameter file, or there was a system runtime error. =back =head1 COPYRIGHT Copyright (c) 2000-2001 Richard Anderson. All rights reserved. Copyright (c) 2001-2003 Ilya Martynov. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L L =cut use strict; use Pod::Usage; use Getopt::Long qw(:config gnu_getopt); use HTTP::WebTest; my %OPTIONS = (); GetOptions(\%OPTIONS, qw(help|? version|V man)) or pod2usage(2); pod2usage(1) if $OPTIONS{help}; pod2usage(-verbose => 2) if $OPTIONS{man}; if($OPTIONS{version}) { my $version = HTTP::WebTest->VERSION; print <new(); my $exit_status = 0; for my $file (@ARGV) { $webtest->run_wtscript($file); $exit_status = 1 unless $webtest->have_succeed; } return $exit_status; }