NAME

Test::STDmaker::Demo - generates demo scripts from a test description short hand

DESCRIPTION

The Test::STDmaker::Demo 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::Check package inherits the methods of the Test::STDmaker package. The Test::STDmaker build generate and <print> methods directs the Test::STDmaker::Demo package to perform its work by calling its methods.

The Test::STDmaker::Demo methods builds a demo script whereby the demo script loads the Test::Tech package and uses the methods from the Test::Tech package.

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

$skip

condition that a test should be skipped

$verify_only

flag that a test is for the verify (test script) output only

The Test::STDmaker::Demo package has the following options that are passed as part of the $self hash from Test::STDmaker methods:

demo

Replaces the UUT DEMONSTRATION POD section with the results from the demo script.

replace

same as the demo option

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 $verify_only object data is set, the A subroutine resets the $verify_only and $skip object data and returns empty for file_data; otherwise, performs the following.

If the skip flag is set, the A subroutine adds the following to the demo script by returning it in $file_data

demo( text_of($actual_expression), $actual-expression) )
  unless C<$skip>;

and resets the $skip condition; otherwise

demo( text_of($actual_expression), $actual-expression) );

E

$file_data = E($command, $expected-expression)

The E subroutine resets the verify_only object data and returns empty for $file_data.

C

$file_data = C($command, $code)

If the $verify_only object data is set, the C subroutine returns empty for file_data; otherwise, adds the following to the demo script by returning it in $file_data

demo( text_of($actual_expression)) )
$actual-expression

DM

$file_data = DM($command, $msg)

The DM subroutine returns empty for $file_data.

DO

$file_data = DO($command, $comment)

The DO subroutine resets the verify_only object data and returns empty for $file_data.

N

$file_data = N($command, $name_data)

If the $verify_only object data is set, the C subroutine returns empty for file_data; otherwise, adds the $name_data as a comment to the demo script by returning it in $file_data

ok

$file_data = ok($command, $test_number)

The ok subroutine returns empty for $file_data.

QC

$file_data = QC($command, $code)

If the verify_only object data is set, the QC subroutine returns empty for file_data; otherwise, adds the following to the demo script by returning it in $file_data

$actual-expression

R

$file_data = R($command, $requirement_data)

The R subroutine returns empty for $file_data.

S

$file_data = S($command, $expression)

SE

$file_data = SE($command, $expected-expression)

The SE subroutine returns empty for $file_data.

SF

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

The SF subroutine returns empty for $file_data.

T

$file_data = T($command,  $tests )

The T subroutine returns empty for $file_data.

TS

$file_data = TS(command, \&subroutine)

The TS subroutine returns empty for $file_data.

U

$file_data = U($command, $comment)

The U subroutine returns empty for $file_data.

VO

$file_data = VO($command, $comment)

The C{VO} subroutine sets the $verify_only flag and returns empty for $file_data.

ADMINSTRATIVE METHODS

AUTOLOAD

The AUTOLOAD subroutine issues a warning whether called by the orphan method $AUTOLOAD

finish

$file_data = finish()

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

post_print

$success = post_print()

If either the demo or replace option is set, the post_print subroutine will run the demo script and replace the DEMONSTRATION section of the UUT POD with the results.

start

$file_data = start()

The start routine returns in $file_data the BEGIN and <END> block for the demo script. The BEGIN block loads the Test::Tech program module, 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.

NOTES

Author

The holder of the copyright and maintainer is

<support@SoftwareDiamonds.com>

Copyrighted (c) 2002 Software Diamonds

All Rights Reserved

Binding Requirement Notice

Binding requirements are indexed with the pharse 'shall[dd]' where dd is an unique number for each header section. This conforms to standard federal government practices, US DOD 490A 3.2.3.6. In accordance with the License, Software Diamonds is not liable for any requirement, binding or otherwise.

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::STD
Test::STDmaker::Verify
Test::STDmaker::Check
Software Test Description
DSpecification Practices
Software Development