The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::STDmaker::Verify - generate test scripts from a test description short hand

DESCRIPTION

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.

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.

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.

During the course of the processing the Test::STDmaker::Verify package maintains the following in the $self object data hash:

$actual

the actual results

$diag_msg

a diagnostic message

$demo_only

Flags if the test is demo only and will be ignore as far as the generating the check test script

$demo_only_expected

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.

$requirement

requirements addressed by test

$skip

skip condition

$name

the name of the test

$subroutine

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:

report

Replace the UUT POD 'Test Report' section with the results from the test script

run

Run the test script under the Test::Harness

test_verbose

Set any Test::Harness run to verbose

nosemi

The C subroutine will not automatically add a ';' at the end of the code field.

TEST DESCRIPTION METHODS

A

 $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.

C

 $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.

DM

 $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

DO

 $file_data = DO($command, $comment);

The DO subroutine sets $demo_only object data to $comment and returns an empty for $file_data

E

 $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:

requirements

adds the $requirement object data as a comment of the requirementd addressed

skip with subroutine

if there is $skip and $subroutine data, adds the below (all arguments except $expected-expression are object data):

  skip_sub( $subroutine,
          $skip,    
          $actual,
          $expected-expression,
          $diag_msg,
          $name);
skip without subroutine

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);
no skip and subroutine

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);
no skip and no subroutine

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 object data

reset the appropriate object data before return the above describe construction as $file_data.

N

 $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

ok

 $file_data = ok($command, $test_number);

The ok subroutine returns the following for $file_data

 # ok: $test_number

QC

 $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.

R

 $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

S

 $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

SE

 $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:

 skip_tests( 1 ) unless

Thus, if the test fails the rest of the tests are skipped effectively stopping the testing.

SF

 $file_data = SF($command, "$value,$msg");

The SF command splits "$value,$msg" and returns the following as $file_data

 skip_tests($value,$msg)

T

 $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.

TS

 $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

U

 $file_data = U($command, $comment);

VO

 $file_data = VO($command, $comment);

The VO subroutine returns a empty for $file_data.

ADMINSTRATIVE METHODS

finish

 $file_data = finish();

The finish subroutine returns adds a short POD to the test script by returning it in $file_data.

post_print

 $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.

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.

start

 $file_data = start();

The start routine initializes the object data.

NOTES

Author

The author, holder of the copyright and maintainer is

<support@SoftwareDiamonds.com>

copyright © 2003 SoftwareDiamonds.com

License

Software Diamonds permits the redistribution and use in source and binary forms, with or without modification, provided that the following conditions are met:

  1. Redistributions of source code, modified or unmodified must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. 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.

  3. 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.

SEE ALSO

Test::Tech
Test
Test::Harness
Test::STDmaker
Test::STDmaker::Demo
Test::STDmaker::STD
Test::STDmaker::Check
STD - Software Test Description
Specification Practices
Software Development

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 829:

'=item' outside of any '=over'

Around line 834:

You forgot a '=back' before '=head2'

Around line 985:

Non-ASCII character seen before =encoding in '©'. Assuming CP1252