Report - collection of functions for working with reports and templates
Shane P. McCarron <shane@aptest.com>
Copyright 2001-2011 Applied Testing and Technology, Inc. All Rights Reserved.
use Report ; # get the list of reports my @rlist = Report::list($suite) ; # get a template my $template = Report::getTemplate($suite, $template...);
The Report package is a collection of functions that are used by all components that offer or display reports.
$errRef = Report::checktemplate(suite, template, profile) ;
suite is the name of a suite to load from.
template is the name of the report template to check.
profile is the name of a profile to operate on instead of a suite.
content is optional new content to check in the context of the suite or profile in question. Used when saving a template before actually committing it to disk.
Returns a reference to a hash. The keys of the hash are references in the template that are illegal. The values of each element are the text of an error message. Returns undef if there are no errors.
$contents = Report::getTemplate(suite, template, strip, profile);
suite is the name of a suite to load from.
template is the name of the report template to load.
strip is a flag that indicates whether to strip off comments or not. Defaults to false.
profile is the name of a profile to operate on instead of a suite.
Returns the contents of the referenced template. Returns undef if the template does not exist. Returns undef if both a suite and a profile are specified.
($comments, $top, $head, $body, $foot) = Report::parseTemplate(suite, template, stripComments, profile);
returns the portion before any thead, the thead portion, the body portion, and the tfoot portion of the template so they can be used in the various portions of a template driven screen
($comments, $top, $head, $body, $foot) = Report::parseContent(string) ;
returns the portion before any thead, the thead portion, the body portion, and the tfoot portion of the template so they can be used in the various portions of a template driven screen
$descRef = Report::desc(suite, name [, profile] ) ;
suite is the name of a test suite.
name is the name of a report.
profile is the optional name of a profile.
Retrieves the description associated with a report in a suite or in a profile.
Returns a hash references to the the description set for the report. Returns undef if the suite, profile, or report do not exist. Also returns undef if both suite and profile are specified.
If the return LHS wants an array, then will return a reference to the hash and the contents of the template.
@list = Report::list(suite, profile, type);
Suite is the name of a Suite.
Profile is the name of a Profile.
type is a report type filter. Defined report types are "spec", "results", and "requirements".
Returns a list of the reports for the suite or profile. It is an error to specify both a suite and a profile.
$path = Report::dir(suite, profile)
suite is the name of a suite.
profile is the name of a profile.
Returns the path to the reports folder in a suite or a profile. It is an error to specify both a suite and a profile.
$path = Report::path(suite, template, profile);
suite is the name of a test suite.
template is the name of a template.
profile is the name of a profile.
Returns the path to the template in the specified suite or profile. It is an error to specify both a suite and a profile.
$width = Report::width(fragment);
fragment is an HTML fragment - this is most likely the "thead" section of a template. If there is no "thead" section, then we usually don't care about the width.
Returns the width of the table in columns. Returns undef if there is no fragment provided or if there is an error in parsing.
my @reports = $rpt->reportList( suite, user, useTests, useResults, useRequirements, fixedReports, nested);
suite is the suite to get the list from
user is the user who's reports we want to see. If not defined, all user's reports are returned.
useTests is a flag; if true, include reports about tests. The default is true.
useResults is a flag; if true, include reports that require results. The default is true.
useRequirements is a flag; if true, include reports about requirements. The default is true if there are requirements in the suite.
fixedReports is a flag; if true, also include the fixed reports. The default is false.
nested is a flag; if true, include any customized reports as children of their parent. The default is true.
my @list = Report::fixedReports() ;
Copyright © 2000-2013 Applied Testing and Technology, Inc. All rights reserved.