Studio:Test Script Perl Template: Difference between revisions
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. | ||
<source lang="perl"> | <source lang="perl"> | ||
Line 54: | Line 54: | ||
</source> | </source> | ||
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: | |||
<div name="index"> | <div name="index"> | ||
<p><a name="__index__"></a></p> | <p><a name="__index__"></a></p> | ||
Line 134: | Line 122: | ||
<h1><a name="copyright">COPYRIGHT</a></h1> | <h1><a name="copyright">COPYRIGHT</a></h1> | ||
<p>Copyright 2008 S2 Technologies <<a href="mailto:support@s2technologies.com">support@s2technologies.com</a>>.</p> | <p>Copyright 2008 S2 Technologies <<a href="mailto:support@s2technologies.com">support@s2technologies.com</a>>.</p> | ||
[Category: Document Templates] | [Category: Document Templates] |
Revision as of 19:07, 29 October 2008
The following sample represents a starting point for perl test scripts.
=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 [1] for documentation, which is an ubiquitous standard for self-contained docs in perl. The pod is easily displayed by simply calling [2] (for command line/shell output) or [3] for html output. The template above produces the following HTML output:
<a name="__index__"></a>
- <a href="#name">NAME</a>
- <a href="#description">DESCRIPTION</a>
- <a href="#tests">TESTS</a>
- <a href="#test_specification">TEST SPECIFICATION</a>
- <a href="#copyright">COPYRIGHT</a>
<a name="name">NAME</a>
[scriptname].pl - [few word summary]
<a name="description">DESCRIPTION</a>
Here is some description text. It can have text that is bolded, italicized, and $code-formatted
.
<a name="tests">TESTS</a>
- <a name="test_case_1" class="item">test case 1.</a>
-
description
- <a name="test_case_2" class="item">test case 2</a>
-
description
- <a name="etc" class="item">etc...</a>
-
description
<a name="test_specification">TEST SPECIFICATION</a>
<a href="http://project-portal.s2technologies.com/index.php/MyTestPlan">http://project-portal.s2technologies.com/index.php/MyTestPlan</a>.
<a name="copyright">COPYRIGHT</a>
Copyright 2008 S2 Technologies <<a href="mailto:support@s2technologies.com">support@s2technologies.com</a>>.
[Category: Document Templates]