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

NAME

Test::STDmaker::Check - checks a software test description short hand

DESCRIPTION

The Test::STDmaker::Check 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 performs the following:

  1. checks the STD database

  2. creates a test description of ordered name,value pairs database array @{$self->{$module}->{test_db}}

  3. generates a check script that numbers the ok the same as if generated by a test script The name for the check script is the STD database Temp field and usually is temp.pl.

  4. Runs the check script to obtan a ok translation table.

  5. Change the ok fields in the STD database according to the ok tranlation table from the check script.

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::Check package to perform its work by calling its methods.

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

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

$ok

Sequential count of the ok fields. This is the initial count enter in the test description data base and used by the clean script to record the true ok count from running the clean script.

$success

Use by the finish subroutine for a diagnostic dump if the process does not go right.

@todo

A list of todo tests.

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

fspec_out

The File_Spec field determines he file specification for the STD database. The finish routine will set the File_Spec to the fspec_out optin if it is present.

The post_generate subroutine will not unlink the check script (usually temp.pl) if there is a nounlink option.

TEST DESCRIPTION METHODS

The test description methods clean up the STD database and contribute to the check script. Data from processing fields that are test descriptions are added to the @{$self->{std_db}} array in the same order as the test description fields. The $file_data return from the test description methods are appended to the check test script.

The test description methods are as follows.

A

 $file_data = A($command, $actual-expression );

The A subroutine appends $command, $actual-expression to @{$self->{std_db}} unchanged and returns '' for $file_data.

If demo_only exists, the A subroutine resets the demo_only flag and sets the demo_only_expected flag; otherwise it resets the demo_only_expected flag.

C

 $file_data = C($command, $code);

The C subroutine appends $command, $code to @{$self->{std_db}} unchanged and returns $code for $file_data.

DO

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

The DO subroutine appends $command, $comment to @{$self->{std_db}} unchanged and returns '' for $file_data.

The subroutine sets the $demo_only flag.

DM

 $file_data = DM($command, $msg);

The DM subroutine appends $command, $msg to @{$self->{std_db}} unchanged returns '' for $file_data.

E

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

The E subroutine appends $command, $expected-expression, 'ok', $ok++ to @{$self->{std_db}} and returns code for incrementing the test count and adding the test count to the ok database in $file_data.

N

 $file_data = N($command, $name_data);

The N subroutine appends $command, $name_data to @{$self->{std_db}} unchanged and returns '' for $file_data.

ok

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

The ok subroutine does nothing.

QC

 $file_data = QC($command, $code);

The QC subroutine appends $command, $code to @{$self->{std_db}} unchanged and returns $code for $file_data.

R

 $file_data = R($command, $requirement_data);

The R subroutine appends $command, $requrement_data to @{$self->{std_db}} unchanged and returns '' for $file_data.

S

 $file_data = S($command, $expression);

The S subroutine appends $command, $expression to @{$self->{std_db}} unchanged and returns '' for $file_data.

SE

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

The SE subroutine appends $command, $expected-expression, 'ok', $ok++ to @{$self->{std_db}} and returns code for incrementing the test count and adding the test count to the ok database in $file_data.

SF

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

The SF subroutine appends $command, "$value,$msg" to @{$self-{std_db}} unchanged and returns '' for $file_data.

T

 $file_data = T($command,  $tests );

The start subroutine initilizes @{$self->{std_db}} to (T,'') as the first name,value pair. There is only one T field per test description database. Thus, the T subroutine does nothing.

TS

 $file_data = TS(command, \&subroutine);

The TS subroutine appends $command, \&subroutine to @{$self-{std_db}} unchanged and returns '' for $file_data.

U

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

The U subroutine appends $command, $comment to @{$self-{std_db}} unchanged and returns '' for $file_data.

VO

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

The VO subroutine appends $command, \&subroutine to @{$self-{std_db}} unchanged and returns '' for $file_data.

ADMINSTRATIVE METHODS

AUTOLOAD

The AUTOLOAD subroutine is a catch for any STD database field that is not a test description fields. Without this catch, Test::STDmaker methods calls with these field names causes a false error.

start

 $file_data = start();

The start subroutine initilizes the object data. 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.

finish

 $file_data = $success = finish();

The finish subroutine performs numerous checks and updates on the $self STD database fields. Some of the checks and updates are as follows:

  • Provides default file output for output targets if one is not specified

  • Ensures all required fields to create a STD are present

The start subroutine returns in $file_data the code to dump the ok translation table.

post_print

 post_print()

The post_print subroutine picks up the ok translation table by running the check test script. The post_print subroutine runs through all the @{self-{std_db}}> database fields, replacing all ok fields with the value from the ok translation table. The post_print method updates the @{self-{std_db}}> database T field with the number of tests.

NOTES

Author

The holder of the copyright and maintainer is

 E<lt>support@SoftwareDiamonds.comE<gt>

Copyrighted (c) 2002 Software Diamonds

All Rights Reserved

Binding Requirements

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, STD490A 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 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 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::Demo
Software Test Description
Specification Practices
Software Development