Studio:Test Script Perl Template: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 44: Line 44:




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. There are also [http://search.cpan.org/~jmcnamara/Pod-Simple-Wiki-0.05/pod2wiki utilities available] for generating wiki text from pod,which could provide a convenient way to autopublish the script documentation to the project wiki. The code above produces the following HTML output:
This template uses [http://www.naturaldocs.org NaturalDocs] for documentation, which is a utility for documenting diverse codebases (including perl, c++, javascript). The documentation can be generated for your files by invoking the [http://www.naturaldocs.org/running.html NaturalDocs Utility]. The code above produces the following HTML output:


{| class="wikitable"
{| class="wikitable"
Line 50: Line 50:
|-
|-
| style="background-color: white;" |
| style="background-color: white;" |
<p>
</p>
<h1>NAME</h1>
<p>[scriptname].pl - [few word summary]</p>


<p>
</p>
<hr />
<h1>DESCRIPTION</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>TESTS</h2>


;test case 1:
<p>description</p>
;test case 2:
<p>description</p>
;etc...:
<p>description</p>


<p>
</p>
<hr />
<h1>TEST SPECIFICATION</h1>
<p>&lt;[http://project-portal.s2technologies.com/index.php/MyTestPlan http://project-portal.s2technologies.com/index.php/MyTestPlan]&gt;.</p>
<p>
</p>
<hr />
<h1>COPYRIGHT</h1>
<p>Copyright 2008 S2 Technologies &lt;[mailto:support@s2technologies.com support@s2technologies.com]&gt;.</p>
|}
|}


[[Category: Document Templates]]
[[Category: Document Templates]]

Revision as of 17:35, 3 November 2008

The following sample represents a starting point for perl test scripts.

Source
=begin nd

Brief summary...

About: Description
Here is some description text.  It can have text that is *bolded* and _underlined_.

About: Tests
test case 1 - description of test case 1
test case 2 - description of test case 2
etc - more cases...

About: Test Plan
See <http://project-portal.s2technologies.com/index.php/MyTestPlan>

About: 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 NaturalDocs for documentation, which is a utility for documenting diverse codebases (including perl, c++, javascript). The documentation can be generated for your files by invoking the NaturalDocs Utility. The code above produces the following HTML output:

HTML result