Test::STDmaker::Verify - generate test scripts from a test description short hand
The Test::STDmaker::Verify package is an internal driver package to the Test::STDmaker package that supports the Test::STDmaker::tmake() method. Any changes to the internal drive interface and this package will not even consider backward compatibility. Thus, this POD serves as a Software Design Folder documentation the current internal design of the Test::STDmaker and its driver packages.
Test::STDmaker::Verify
Test::STDmaker
The Test::STDmaker::Verify package inherits the methods of the Test::STDmaker package. The Test::STDmaker build generate and <print> methods directs the Test::STDmaker::Verify package to perform its work by calling its methods.
build
generate
The Test::STDmaker::Verify methods builds a test script whereby the test script loads the Test::Tech package and uses the methods from the Test::Tech package.
Test::Tech
During the course of the processing the Test::STDmaker::Verify package maintains the following in the $self object data hash:
$self
the actual results
a diagnostic message
Flags if the test is demo only and will be ignore as far as the generating the check test script
Once only flag set by the A subroutine and reset by the next E subroutine. There should be no E subroutine after a A demo only subroutine.
A
E
requirements addressed by test
skip condition
the name of the test
a reference to a test subroutine
}
The Test::STDmaker::Verify package processes the following options that are passed as part of the $self hash from Test::STDmaker methods:
Replace the UUT POD 'Test Report' section with the results from the test script
Run the test script under the Test::Harness
Set any Test::Harness run to verbose
The C subroutine will not automatically add a ';' at the end of the code field.
C
$file_data = A($command, $actual-expression );
If the demo_only object data is set, the A subroutine resets the object data and returns empty for $file_data; otherwise, the subroutine saves the $actual-expression in the $actual object data and returns empty for $file_data.
demo_only
$file_data
$actual-expression
$actual
$file_data = C($command, $code);
If the demo_only object data is set, the C subroutine returns empty for $file_data; otherwise, the subroutine returns $file_data with $code and a comment.
$code
$file_data = DM($command, $msg);
If the demo_only object data is set, the DM subroutine returns empty for $file_data; otherwise, the subroutine sets $diag_msg object data to $msg and returns an empty for $file_data
DM
$diag_msg
$msg
$file_data = DO($command, $comment);
The DO subroutine sets $demo_only object data to $comment and returns an empty for $file_data
DO
$demo_only
$comment
$file_data = E($command, $expected-expression)
If the demo_only object data is set, the E subroutine resets the object data and returns empty for $file_data; otherwise, the subroutine builds and returns $file_data as follows:
adds the $requirement object data as a comment of the requirementd addressed
$requirement
if there is $skip and $subroutine data, adds the below (all arguments except $expected-expression are object data):
$skip
$subroutine
skip_sub( $subroutine, $skip, $actual, $expected-expression, $diag_msg, $name);
if there is $skip and no $subroutine data, adds the below (all arguments except $expected-expression are object data):
skip( $subroutine, $skip, $actual, $expected-expression, $diag_msg, $name);
if there is no $skip and $subroutine data, adds the below (all arguments except $expected-expression are object data):
ok_sub( $subroutine, $actual, $expected-expression, $diag_msg, $name);
if there is no $skip and no $subroutine data, adds the below (all arguments except $expected-expression are object data):
ok( $actual, $expected-expression, $diag_msg, $name);
reset the appropriate object data before return the above describe construction as $file_data.
$file_data = N($command, $name_data);
If the demo_only object data is set, the N subroutine returns empty for $file_data; otherwise, the subroutine sets $name object data to $name_data and returns an empty for $file_data
N
$name
$name_data
$file_data = ok($command, $test_number);
The ok subroutine returns the following for $file_data
ok
# ok: $test_number
$file_data = QC($command, $code);
If the demo_only object data is set, the QC subroutine returns empty for $file_data; otherwise, the subroutine returns $file_data with $code and a comment.
QC
$file_data = R($command, $requirement_data);
If the demo_only object data is set, the R subroutine returns empty for $file_data; otherwise, the subroutine sets $requirement object data to $requirement_data and returns an empty for $file_data
R
$requirement_data
$file_data = S($command, $expression);
If the demo_only object data is set, the S subroutine returns empty for $file_data; otherwise, the subroutine sets $skip object data to $expression and returns an empty for $file_data
S
$expression
$file_data = SE($command, $expected-expression);
The SE subroutine performs the same processing as the S subroutine expect that the subroutine also adds the following to the beginning of $file_data:
SE
skip_tests( 1 ) unless
Thus, if the test fails the rest of the tests are skipped effectively stopping the testing.
$file_data = SF($command, "$value,$msg");
The SF command splits "$value,$msg" and returns the following as $file_data
SF
"$value,$msg"
skip_tests($value,$msg)
$file_data = T($command, $tests );
The T routine returns in $file_data the BEGIN and <END> block for the demo script. The BEGIN block loads the Test::Tech program module, executes a plan($tests), changes the working directory to the directory of the demo script, and adds some extra directories to the front of @INC. The <END> block restores everything to the state before the execution of the BEGIN block.
T
BEGIN
plan($tests)
@INC
$file_data = TS(command, \&subroutine);
If the demo_only object data is set, the TS subroutine returns empty for $file_data; otherwise, the subroutine sets $subroutine object data to \&subroutine and returns an empty for $file_data
TS
\&subroutine
$file_data = U($command, $comment);
$file_data = VO($command, $comment);
The VO subroutine returns a empty for $file_data.
VO
$file_data = finish();
The finish subroutine returns adds a short POD to the test script by returning it in $file_data.
finish
$success = post_print();
If the report option is set, the post_print subroutine will run the test script and replace the 'Test Report' section of the UUT POD with the results.
report
post_print
If the run option is set, the post_print subroutine will run the test script under the Test::Harness. If the test_verbose option is set, the subroutine runs the test harness in verbose.
run
test_verbose
$file_data = start();
The start routine initializes the object data.
start
The author, holder of the copyright and maintainer is
<support@SoftwareDiamonds.com>
copyright © 2003 SoftwareDiamonds.com
Software Diamonds permits the redistribution and use in source and binary forms, with or without modification, provided that the following conditions are met:
Redistributions of source code, modified or unmodified must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Commercial installation of the binary or source must visually present to the installer the above copyright notice, this list of conditions intact, that the original source is available at http://softwarediamonds.com and provide means for the installer to actively accept the list of conditions; otherwise, a license fee must be paid to Softwareware Diamonds.
SOFTWARE DIAMONDS, http://www.SoftwareDiamonds.com, PROVIDES THIS SOFTWARE 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTWARE DIAMONDS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING USE OF THIS SOFTWARE, EVEN IF ADVISED OF NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE POSSIBILITY OF SUCH DAMAGE.
3 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
Non-ASCII character seen before =encoding in '©'. Assuming CP1252
To install Test::STDmaker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::STDmaker
CPAN shell
perl -MCPAN -e shell install Test::STDmaker
For more information on module installation, please visit the detailed CPAN module installation guide.