Studio:Test Script Perl Template: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The following sample represents a starting point for perl test scripts. | The following sample represents a starting point for perl test scripts. | ||
{| class="wikitable" | |||
!Source | |||
|- | |||
| style="background-color: white;" | | |||
<source lang="perl"> | <source lang="perl"> | ||
=head1 NAME | =head1 NAME | ||
Line 53: | Line 57: | ||
use lib $StrideLibDirectory; | use lib $StrideLibDirectory; | ||
</source> | </source> | ||
|} | |||
This template uses [http://perldoc.perl.org/perlpod.html | This template uses [http://perldoc.perl.org/perlpod.html pod] for documentation, which is an ubiquitous standard for self-contained docs in perl. The pod is easily displayed by simply calling [http://perldoc.perl.org/perldoc.html perldoc] (for command line/shell output) or [http://perldoc.perl.org/pod2html.html pod2html] for html output. The template above produces the following HTML output: | ||
{| class="wikitable" | |||
!HTML result | |||
|- | |||
| style="background-color: white;" | | |||
<p> | <p> | ||
</p> | </p> | ||
<h1> | <h1>NAM</h1> | ||
<p>[scriptname].pl - [few word summary]</p> | <p>[scriptname].pl - [few word summary]</p> | ||
Line 84: | Line 73: | ||
</p> | </p> | ||
<hr /> | <hr /> | ||
<h1> | <h1>DESCRIPTIO</h1> | ||
<p>Here is some description text. It can have text that is <strong>bolded</strong>, <em>italicized</em>, and <code>$code-formatted</code>.</p> | <p>Here is some description text. It can have text that is <strong>bolded</strong>, <em>italicized</em>, and <code>$code-formatted</code>.</p> | ||
<p> | <p> | ||
</p> | </p> | ||
<h2 | <h2>TESTS</h2> | ||
<dl> | <dl> | ||
<dt><strong | <dt><strong>test case 1.</strong> | ||
<dd> | <dd> | ||
Line 97: | Line 86: | ||
</dd> | </dd> | ||
</li> | </li> | ||
<dt><strong | <dt><strong>test case 2</strong> | ||
<dd> | <dd> | ||
Line 104: | Line 93: | ||
</li> | </li> | ||
<dt><strong | <dt><strong>etc...</strong> | ||
<dd> | <dd> | ||
Line 114: | Line 103: | ||
</p> | </p> | ||
<hr /> | <hr /> | ||
<h1 | <h1>TEST SPECIFICATION</h1> | ||
<p> | <p><[http://project-portal.s2technologies.com/index.php/MyTestPlan]>.</p> | ||
<p> | <p> | ||
Line 121: | Line 110: | ||
<hr /> | <hr /> | ||
<h1><a name="copyright">COPYRIGHT</a></h1> | <h1><a name="copyright">COPYRIGHT</a></h1> | ||
<p>Copyright 2008 S2 Technologies < | <p>Copyright 2008 S2 Technologies <[mailto:support@s2technologies.com support@s2technologies.com]>.</p> | ||
|} | |||
[Category: Document Templates] | [Category: Document Templates] |
Revision as of 19:20, 29 October 2008
The following sample represents a starting point for perl test scripts.
Source |
---|
=head1 NAME
[scriptname].pl - [few word summary]
=head1 DESCRIPTION
Here is some description text. It can have text that is B<bolded>, I<italicized>, and C<$code-formatted>.
=head2 TESTS
=over 4
=item test case 1.
description
=item test case 2
description
=item etc...
description
=back
=head1 TEST SPECIFICATION
L<http://project-portal.s2technologies.com/index.php/MyTestPlan>.
=head1 COPYRIGHT
Copyright 2008 S2 Technologies <support@s2technologies.com>.
=cut
use strict;
use warnings;
use Carp;
use Win32::TieRegistry(Delimiter=>"/");
use File::Spec;
use Win32::OLE;
Win32::OLE->Option(Warn => 3);
use vars qw( $StrideLibDirectory );
BEGIN {
my $strideDir = $Registry->{"LMachine/SOFTWARE/S2 Technologies/STRIDE/InstallDir"} || $ENV{'STRIDE_DIR'};
$StrideLibDirectory = File::Spec->catdir($StrideDirectory, 'lib', 'perl');
}
use lib $StrideLibDirectory;
|
This template uses pod for documentation, which is an ubiquitous standard for self-contained docs in perl. The pod is easily displayed by simply calling perldoc (for command line/shell output) or pod2html for html output. The template above produces the following HTML output:
HTML result |
---|
NAM[scriptname].pl - [few word summary]
DESCRIPTIOHere is some description text. It can have text that is bolded, italicized, and
TESTS
TEST SPECIFICATION<[1]>.
<a name="copyright">COPYRIGHT</a>Copyright 2008 S2 Technologies <support@s2technologies.com>. |
[Category: Document Templates]