winIDEA SDK
isys::CTestReportConfig Class Reference

Description

This class contains information about test report, which is implicitly contained in the report, for example report format, and user info about test.


Python example.

#include <CTestReportConfig.h>

Inheritance diagram for isys::CTestReportConfig:
isys::CTestBase

Public Types

enum  EReportContents { RCONFIG_FULL , RCONFIG_ERRORS_ONLY }
 Defines the amount of information in the report. More...
 
enum  EOutputFormat {
  FMT_XML , FMT_YAML ,
  FMT_CSV , FMT_XLS ,
  FMT_XLSX
}
 Define the report file format. More...
 
enum  ETestReportConfigSectionIds
 Ids of test specification sections.
 

Public Member Functions

 CTestReportConfig ()
 Initializes new instance with NULL parent.
 
 CTestReportConfig (const isys::CTestBaseSPtr &parent)
 Initializes new instance. More...
 
EReportContents getReportContents ()
 Returns the type of contents in the report.
 
std::string getTestIDEAVersion ()
 Returns version of testIDEA used for running tests as set by client.
 
EOutputFormat getOutputFormat ()
 Returns the output format of the report.
 
std::string getFileName ()
 Returns the name of the file to save report to.
 
std::string getIYamlFileName ()
 Returns name of iyaml file, which was used to generate this report.
 
std::string getAbsReportFileName ()
 Returns the absolute name of the file to save report to. More...
 
std::string getXsltForFullReport ()
 Returns the name of the file to use as XML Stylesheet for the full report.
 
std::string getXsltForErrors ()
 
std::string getLogoImageFileName ()
 Returns file name for logo image in report.
 
std::string getCssFile ()
 Returns the name of the file to use as CSS for report.
 
bool isEmbedXsltCss ()
 Returns true, if XSLT and CSS files should be embedded into XML report.
 
bool isCreateHtml ()
 Returns true, if HTML file should also be created by processing created XML and XSLT. More...
 
std::string getSelectedXsltFileName ()
 Returns XSLT file name for full report or for errors only report, depending on the value of output format.
 
std::string getCSVSeparator ()
 Returns separator to be used in CSV report files.
 
bool isCSVHeaderLine ()
 Returns true, if header line in CSV report format should contain names of columns.
 
bool isXLSVerticalHeader ()
 Returns true, if column headers in XLS tables should be written vertically.
 
bool isIncludeTestSpec ()
 Returns true, is test specification should be included into test report.
 
bool isAbsPathForLinks ()
 If true is returned, then links in report (for example to export files) will be written with absolute path.
 
void getUserInfo (iconnect::StrStrMap &userInfoMap)
 Returns a map of key-value pairs to be stored into report, for example HW used for testing.
 
bool hasUserInfo (const std::string &key)
 Returns true, if a user info for the given key exists in mapping. More...
 
std::string getXmlReportHeader ()
 Returns XML report header.
 
std::string getWarnings ()
 If there were any warnings detected during parsing, this method returns non-empty string with description of warnings. More...
 
void setReportContents (EReportContents reportContents)
 Sets the type of information to be stored in the report.
 
void setTestIDEAVersion (const std::string &testIDEAVersion)
 Sets version of testIDEA used for running tests.
 
void setOutputFormat (EOutputFormat outFormat)
 Sets report output format.
 
void setFileName (const std::string &fileName)
 Sets the name of the report file.
 
void setIYamlFileName (const std::string &fileName)
 Sets the name of the iyaml file, which generated this report.
 
void setXsltForFullReport (const std::string &xsltFileName)
 Sets file name for XSLT for full reports.
 
void setXsltForErrors (const std::string &xsltFileName)
 Sets file name for XSLT for reports, which contains errors only.
 
void setLogoImageFileName (const std::string &logoImageFileName)
 Returns file name for logo image in report.
 
void setCssFile (const std::string &cssFileName)
 Sets file to be used as a style-sheet for HTML rendering.
 
void setCsvSeparator (const std::string &csvSeparator)
 Sets CSV separator.
 
void setCsvHeaderLine (bool isCsvHeaderLine)
 If isCsvHeaderLine is set to true, then header line with names of columns is added to CSV test report file.
 
void setXLSVerticalHeader (bool isXLSVerticalHeader)
 Sets XLS columns headers orientation.
 
void setIncludeTestSpec (bool isIncTestSpec)
 Sets flag .
 
void setXmlReportHeader (const std::string &header)
 Sets header for XML reports.
 
void setUserInfo (const std::string &yamlSpec)
 Sets mapping of user info, given in yaml format.
 
void clearDynamicUserItems ()
 Removes all items with key prefix '_'. More...
 
void setAbsPathForLinks (bool iaAbsPathsForLinks)
 If set to true, then links in report (for example to export files) will be written with absolute path.
 
void addUserInfo (const std::string &key, const std::string &value)
 Adds key/value pair to user info. More...
 
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
 
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
 
virtual std::string toString ()
 Returns object data as YAML string.
 

Static Public Member Functions

static CTestReportConfigSPtr cast (const CTestBaseSPtr &testBase)
 Casts the given object to this class. More...
 

Protected Member Functions

void setStaticTagsAsConst ()
 This method is called by all objects which are immediately contained in CTestSpecification, for example CTestCoverage, CTestHIL, ...
 

Member Enumeration Documentation

◆ EOutputFormat

Define the report file format.

Enumerator
FMT_XML 

XML format.

FMT_YAML 

YAML format.

FMT_CSV 

Comma Separated Values format.

FMT_XLS 

the old Excel binary format

FMT_XLSX 

the new Excel XML format

◆ EReportContents

Defines the amount of information in the report.

Enumerator
RCONFIG_FULL 

all measured values are in the report

RCONFIG_ERRORS_ONLY 

only values which do not match expected are saved into report

Constructor & Destructor Documentation

◆ CTestReportConfig()

isys::CTestReportConfig::CTestReportConfig ( const isys::CTestBaseSPtr parent)

Initializes new instance.

Parameters
parentan instance of parent CTestSpecification class. Used only when parsing YAML declaration. Can be specified as NULL if the object is not initialized by parser.

Member Function Documentation

◆ addUserInfo()

void isys::CTestReportConfig::addUserInfo ( const std::string &  key,
const std::string &  value 
)

Adds key/value pair to user info.

Parameters
keymust be alphanumeric string
valueany string

◆ cast()

static CTestReportConfigSPtr isys::CTestReportConfig::cast ( const CTestBaseSPtr testBase)
static

Casts the given object to this class.

Returns NULL if input is NULL.

Exceptions
IllegalArgumentExceptionif input object is not instance of this class.

◆ clearDynamicUserItems()

void isys::CTestReportConfig::clearDynamicUserItems ( )

Removes all items with key prefix '_'.

These items are normally added by script called before report is saved, and are not supposed to be saved to iyaml file, for example subversion revision number of sources tested. It is up to user which items assigned by script should be preserved between sessions and saved to yaml file, and which not. The user defines this behavior by using prefix '_'

◆ getAbsReportFileName()

std::string isys::CTestReportConfig::getAbsReportFileName ( )

Returns the absolute name of the file to save report to.

If report file name is already an absolute path, it is returned unchanged. If it is a relative path, then path of iyaml file is added to it.

◆ getWarnings()

std::string isys::CTestReportConfig::getWarnings ( )

If there were any warnings detected during parsing, this method returns non-empty string with description of warnings.

It is recommended to call this method always after parsing.

See also
CTestBench::getWarnings()

◆ getXsltForErrors()

std::string isys::CTestReportConfig::getXsltForErrors ( )
Deprecated:
only one xslt may be specified, call getXsltForFullReport(). Returns the name of the file to use as XML Stylesheet for report, which contains errors only.

◆ hasUserInfo()

bool isys::CTestReportConfig::hasUserInfo ( const std::string &  key)

Returns true, if a user info for the given key exists in mapping.

Parameters
keymapping key.

◆ isCreateHtml()

bool isys::CTestReportConfig::isCreateHtml ( )

Returns true, if HTML file should also be created by processing created XML and XSLT.

Has effect only if report is generated in XML format.