NAME

Result - result definition class

AUTHOR

Shane P. McCarron <shane@aptest.com>

COPYRIGHT

Copyright 1999-2011 Applied Testing and Technology, Inc. All Rights Reserved.

SYNOPSIS

use Results;

    # create a schema object
    my $results = new Results(suiteName);

    # get a description associated with a result
    $desc = $results->description($res)

METHODS

new - open the Results file

$results = new Results(suite[, profName [, resPath ] ] );

Creates a new results object.

suite

the name of a test suite to access.

profName

the name of the profile to manipulate.

resPath

a path to a results file (for testing).

returns a reference to the results object.

as_popup - emit the selection list of results as a popup list

$output = $results->as_popup(varname, current, fn, noDesvc);

varname is the name of the HTML variable to use

current is the currently selected item.

fn is a function to invoke on change.

noDesc is a boolean. If true the description is not included. If false, it is included. Defaults to false.

Returns a select and option set that uses the name varname, with the item current selected (if defined).

as_radio - emit the selection list of results as a radio button set

$output = $results->as_radio(varname, current, fn);

varname is the name of the HTML variable to use

current is the currently selected item.

fn is a function to call on change.

Returns a set of radio buttons that use the name varname, with the item current selected (if defined).

as_html - emit a result as HTML

$output = $results->as_html(result);

Returns the HTML version of the result, including appropriate colors.

averageResult - determine the modal average result

$realResult = $results->averageResult( resList ) ;

resList is a list of 2 or more result codes. This method will look at all of them, returning the result which is is the most prevalent (e.g., the modal average), rounding toward the worse in the event of a tie.

Returns the result code for the average result from the list.

bestResult - determine the "best" result

$realResult = $results->bestResult( resList ) ;

resList is a list of 2 or more result codes. This method will look at all of them, returning the result which is classified as the "best" by the result definitions. In this case, that means the result that is earliest in the result file.

Returns the result code for the best result from the list.

worstResult - determine the "worst" result

$realResult = $results->worstResult( resList ) ;

resList is a list of 2 or more result codes. This method will look at all of them, returning the result which is classified as the "worst" by the result definitions. In this case, that means the result that is latest in the result file.

Returns the result code for the worst result from the list.

color - accessor for the color associated with a result

$color = $results->color(resname [, color] )

resname is the name of a result to look up.

color is an optional color to set.

Returns the color associated with the result, or undef if the color is not defined.

description - get the description for a result name

$desc = $results->description();

flags - return the flags for a result

flagRef = $results->flags(result) ;
    flagRef = $results->flags(result [, flag, state] ) ;

If the optional flag parameter is specified, sets the state of flag for the result.

Returns a reference to a list of flags set for this result. Flags include 'exclude', 'obsolete', 'hidden', 'incomplete', 'notify'.

isExcluded - should a result be excluded from the 'executed' count

$state = $results->isExcluded(res) ;

Returns true if the exclude flag is set on the result.

isHidden - should a result be hidden

$state = $results->isHidden(res) ;

Returns true if the hidden flag is set on the result.

isIncomplete - is this result considered incomplete?

$state = $results->isIncomplete(res) ;

Returns true if the incomplete flag is set on the result.

isObsolete - is this result considered obsolete?

$state = $results->isObsolete(res) ;

Returns true if the obsolete flag is set on the result.

name - return the name associated with a result

$name = $results->name(resname)

resname is the identifier of a result to look up.

Returns the original name from the input file.

olist - return a hashRef keyed by result id

$hRef = $results->olist() ;

resByStatus - return a result associated with a status code.

$res = $results->resByStatus( status )

status is an exit status.

Returns the result associated with that status code, or undef if no result is found.

rlist - retrieve an ordered list of results

@list = $results->rlist();

shouldNotify - should a notification be sent when this result is used

$state = $results->shouldNotify(res) ;

Returns true if the notify flag is set on the result.

slist - return a hashRef keyed by status

$hRef = $results->slist() ;

numResults - accessor for the number of defined results

$results->numResults();

returns the number of results defined for the suite

ordinal - returns the ordinal number of a result name in the result list

$ord = $results->ordinal(resName) ;

Returns the position of the result in the list, or undef if the result name is not defined.

release - release the object

Really a no-op, since this object does not have a database.

status - get the status code for a result name

$stat = $results->status();

sortedRlist - return a list of results in result file order

@rlist = $resH->sortedRlist( [rlist] ) ;

rlist is an option array of results that need to be ordered.

Returns the list after ordering it to match what is in results file.

write - write out the results file

my $status = $resH->write() ;

Updates the results file for the current suite / profile with the current state of the result object.

Returns 1 on success, 0 on failure.

serialize - create a serialized version of the object

my $text = $schema->serialize() ;

Returns a text representation of the object, suitable for saving.

Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.