ApTest Manager documentation: API: Report

Report

NAME

Report - collection of functions for working with reports and templates

AUTHOR

Shane P. McCarron <shane@aptest.com>

COPYRIGHT

Copyright 2001-2006 Applied Testing and Technology, Inc. All Rights Reserved.

SYNOPSIS

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.

METHODS

checkTemplate - ensure a template has legal references

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

getTemplate - load a report template

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

parseTemplate - get a template and break it down

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

parseContent - break apart a string into template parts

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

desc - return the description set for a report

$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 - return a list of reports in a suite or profile

@list = Report::list(suite, profile);

Suite is the name of a Suite.

Profile is the name of a Profile.

Returns a list of the reports for the suite or profile. It is an error to specify both a suite and a profile.

dir - return the path to the directory of reports

$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 - return the path to a specific report

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

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