Studio:Test Script Perl Template: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
(New page: [Category: Document Templates])
 
No edit summary
Line 1: Line 1:
The following sample represents a starting point for perl test scripts.  It uses [ |pod] for documentation
<source lang="perl">
=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;
</source>
<nowiki>
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[scriptname].pl - [few word summary]</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#tests">TESTS</a></li>
</ul>
<li><a href="#test_specification">TEST SPECIFICATION</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>[scriptname].pl - [few word summary]</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></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>
</p>
<h2><a name="tests">TESTS</a></h2>
<dl>
<dt><strong><a name="test_case_1" class="item">test case 1.</a></strong>
<dd>
<p>description</p>
</dd>
</li>
<dt><strong><a name="test_case_2" class="item">test case 2</a></strong>
<dd>
<p>description</p>
</dd>
</li>
<dt><strong><a name="etc" class="item">etc...</a></strong>
<dd>
<p>description</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="test_specification">TEST SPECIFICATION</a></h1>
<p><a href="http://project-portal.s2technologies.com/index.php/MyTestPlan">http://project-portal.s2technologies.com/index.php/MyTestPlan</a>.</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2008 S2 Technologies &lt;<a href="mailto:support@s2technologies.com">support@s2technologies.com</a>&gt;.</p>
</body>
</html>
</nowiki>
[Category: Document Templates]
[Category: Document Templates]

Revision as of 19:01, 29 October 2008

The following sample represents a starting point for perl test scripts. It uses [ |pod] for documentation

=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;

<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>[scriptname].pl - [few word summary]</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#description">DESCRIPTION</a></li> <ul> <li><a href="#tests">TESTS</a></li> </ul> <li><a href="#test_specification">TEST SPECIFICATION</a></li> <li><a href="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>[scriptname].pl - [few word summary]</p> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></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> </p> <h2><a name="tests">TESTS</a></h2> <dl> <dt><strong><a name="test_case_1" class="item">test case 1.</a></strong> <dd> <p>description</p> </dd> </li> <dt><strong><a name="test_case_2" class="item">test case 2</a></strong> <dd> <p>description</p> </dd> </li> <dt><strong><a name="etc" class="item">etc...</a></strong> <dd> <p>description</p> </dd> </li> </dl> <p> </p> <hr /> <h1><a name="test_specification">TEST SPECIFICATION</a></h1> <p><a href="http://project-portal.s2technologies.com/index.php/MyTestPlan">http://project-portal.s2technologies.com/index.php/MyTestPlan</a>.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2008 S2 Technologies <<a href="mailto:support@s2technologies.com">support@s2technologies.com</a>>.</p> </body> </html>


[Category: Document Templates]