winIDEA SDK
Loading...
Searching...
No Matches
isys::CTestReportConfig Class Reference

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

#include <CTestReportConfig.h>

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

Public Types

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

Public Member Functions

void addUserInfo (const std::string &key, const std::string &value)
 Adds key/value pair to user info.
virtual void assign (const CTestObjectSPtr &base)
 Assigns members of base to this.
void clearDynamicUserItems ()
 Removes all items with key prefix _.
bool containsSection (int section) const
 Returns true, if the specified section exists for this object.
virtual CTestObjectSPtr copy () const
 Creates a deep copy of this object.
CTestBaseSPtr createInstance (const CTestBaseSPtr &parent) const
 CTestReportConfig ()
 Initializes new instance with NULL parent.
 CTestReportConfig (const isys::CTestBaseSPtr &parent)
 Initializes new instance.
std::string getAbsReportFileName ()
 Returns the absolute name of the file to save report to.
std::string getClassName () const
virtual CTestTreeNodeSPtr getContainerTestNode ()
 virtual CTestSpecificationSPtr getContainerTestSpec();
std::string getCssFile ()
 Returns the name of the file to use as CSS for report.
std::string getCSVSeparator ()
 Returns separator to be used in CSV report files.
int getEnumTagValue (int section)
 Returns value of enum type.
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 getLogoImageFileName ()
 Returns file name for logo image in report.
EOutputFormat getOutputFormat ()
 Returns the output format of the report.
CTestBaseSPtr getParent () const
 Returns parent.
EReportContents getReportContents ()
 Returns the type of contents in the report.
int getSectionId (const std::string &sectionName)
 Returns section ID for the given section name.
std::string getSelectedXsltFileName ()
 Returns XSLT file name for full report or for errors only report, depending on the value of output format.
CTestBaseSPtr getTestBase (int section, bool isConst)
CTestBaseListSPtr getTestBaseList (int section, bool isConst)
std::string getTestIDEAVersion ()
 Returns version of testIDEA used for running tests as set by client.
CTestObject::ETestObjType getTestObjType () const
 Returns type of this object, which is CTestObject::ETestBase.
void getUserInfo (iconnect::StrStrMap &userInfoMap)
 Returns a map of key-value pairs to be stored into report, for example HW used for testing.
std::string getWarnings ()
 If there were any warnings detected during parsing, this method returns non-empty string with description of warnings.
std::string getWinIDEAVersion ()
 Returns version of winIDEA used for running tests as set by client.
std::string getXmlReportHeader ()
 Returns XML report header.
std::string getXsltForErrors ()
std::string getXsltForFullReport ()
 Returns the name of the file to use as XML Stylesheet for the full report.
bool hasUserInfo (const std::string &key)
 Returns true, if a user info for the given key exists in mapping.
bool isAbsPathForLinks ()
 If true is returned, then links in report (for example to export files) will be written with absolute path.
bool isCreateHtml ()
 Returns true, if HTML file should also be created by processing created XML and XSLT.
bool isCSVHeaderLine ()
 Returns true, if header line in CSV report format should contain names of columns.
bool isEmbedXsltCss ()
 Returns true, if XSLT and CSS files should be embedded into XML report.
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
bool isIncludeTestSpec ()
 Returns true, is test specification should be included into test report.
bool isSectionEmpty (int sectionId)
 Returns true, if the given section is empty.
virtual bool isSerializedAsList (bool isParsing)
 Returns true if object should be serialized as list, for example CTestFunction.
bool isXLSVerticalHeader ()
 Returns true, if column headers in XLS tables should be written vertically.
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
void setAbsPathForLinks (bool iaAbsPathsForLinks)
 If set to true, then links in report (for example to export files) will be written with absolute path.
virtual void setComment (int section, int idx, const std::string &nlComment, const std::string &eolComment)
void setCssFile (const std::string &cssFileName)
 Sets file to be used as a style-sheet for HTML rendering.
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 setCsvSeparator (const std::string &csvSeparator)
 Sets CSV separator.
void setEnumTagValue (int section, int enumValue)
 Sets value of enum type.
void setFileName (const std::string &fileName)
 Sets the name of the report file.
void setIncludeTestSpec (bool isIncTestSpec)
 Sets flag .
void setIYamlFileName (const std::string &fileName)
 Sets the name of the iyaml file, which generated this report.
void setLogoImageFileName (const std::string &logoImageFileName)
 Returns file name for logo image in report.
virtual void setMainMapStyle (isys::IEmitter::EYamlStyle mappingStyle)
 Sets style of the mapping for complete object.
void setOutputFormat (EOutputFormat outFormat)
 Sets report output format.
void setParent (CTestBaseSPtr parent)
 Sets parent.
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 setUserInfo (const std::string &yamlSpec)
 Sets mapping of user info, given in yaml format.
void setWinIDEAVersion (const std::string &winIDEAVersion)
 Sets version of winIDEA used for running tests.
void setXLSVerticalHeader (bool isXLSVerticalHeader)
 Sets XLS columns headers orientation.
void setXmlReportHeader (const std::string &header)
 Sets header for XML reports.
void setXsltForErrors (const std::string &xsltFileName)
 Sets file name for XSLT for reports, which contains errors only.
void setXsltForFullReport (const std::string &xsltFileName)
 Sets file name for XSLT for full reports.
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.

Protected Member Functions

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

Detailed 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: create_test_report.py

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() [1/2]

isys::CTestReportConfig::CTestReportConfig ( )

Initializes new instance with NULL parent.

Since
9.12.288

◆ CTestReportConfig() [2/2]

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.
Since
9.12.288

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
Since
9.12.288

◆ assign()

virtual void isys::CTestBase::assign ( const CTestObjectSPtr & base)
virtualinherited

Assigns members of base to this.

Since
9.12.288

Reimplemented in isys::CTestFunction.

◆ cast()

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 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 _

Since
9.12.288

◆ containsSection()

bool isys::CTestBase::containsSection ( int section) const
inherited

Returns true, if the specified section exists for this object.

Since
9.12.288

◆ copy()

virtual CTestObjectSPtr isys::CTestBase::copy ( ) const
virtualinherited

Creates a deep copy of this object.

Parent is set.

Since
9.12.288

◆ createInstance()

CTestBaseSPtr isys::CTestReportConfig::createInstance ( const CTestBaseSPtr & parent) const
virtual
Since
9.12.288

Implements isys::CTestBase.

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

Since
9.12.288

◆ getClassName()

std::string isys::CTestBase::getClassName ( ) const
inherited
Since
9.12.288

◆ getContainerTestNode()

virtual CTestTreeNodeSPtr isys::CTestBase::getContainerTestNode ( )
virtualinherited

virtual CTestSpecificationSPtr getContainerTestSpec();

Since
9.12.288

◆ getCssFile()

std::string isys::CTestReportConfig::getCssFile ( )

Returns the name of the file to use as CSS for report.

Since
9.12.288

◆ getCSVSeparator()

std::string isys::CTestReportConfig::getCSVSeparator ( )

Returns separator to be used in CSV report files.

Since
9.12.288

◆ getEnumTagValue()

int isys::CTestBase::getEnumTagValue ( int section)
inherited

Returns value of enum type.

Since
9.12.288

◆ getFileName()

std::string isys::CTestReportConfig::getFileName ( )

Returns the name of the file to save report to.

Since
9.12.288

◆ getIYamlFileName()

std::string isys::CTestReportConfig::getIYamlFileName ( )

Returns name of iyaml file, which was used to generate this report.

Since
9.12.288

◆ getLogoImageFileName()

std::string isys::CTestReportConfig::getLogoImageFileName ( )

Returns file name for logo image in report.

Since
9.12.288

◆ getOutputFormat()

EOutputFormat isys::CTestReportConfig::getOutputFormat ( )

Returns the output format of the report.

Since
9.12.288

◆ getParent()

CTestBaseSPtr isys::CTestBase::getParent ( ) const
inherited

Returns parent.

Since
9.12.288

◆ getReportContents()

EReportContents isys::CTestReportConfig::getReportContents ( )

Returns the type of contents in the report.

Since
9.12.288

◆ getSectionId()

int isys::CTestBase::getSectionId ( const std::string & sectionName)
inherited

Returns section ID for the given section name.

Since
9.12.288

◆ getSelectedXsltFileName()

std::string isys::CTestReportConfig::getSelectedXsltFileName ( )

Returns XSLT file name for full report or for errors only report, depending on the value of output format.

Since
9.12.288

◆ getTestBase()

CTestBaseSPtr isys::CTestBase::getTestBase ( int section,
bool isConst )
inherited
Since
9.12.288

◆ getTestBaseList()

CTestBaseListSPtr isys::CTestBase::getTestBaseList ( int section,
bool isConst )
inherited
Since
9.12.288

◆ getTestIDEAVersion()

std::string isys::CTestReportConfig::getTestIDEAVersion ( )

Returns version of testIDEA used for running tests as set by client.

Since
9.12.288

◆ getTestObjType()

CTestObject::ETestObjType isys::CTestBase::getTestObjType ( ) const
inherited

Returns type of this object, which is CTestObject::ETestBase.

Since
9.12.288

◆ getUserInfo()

void isys::CTestReportConfig::getUserInfo ( iconnect::StrStrMap & userInfoMap)

Returns a map of key-value pairs to be stored into report, for example HW used for testing.

Since
9.12.288

◆ 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()
Since
9.12.288

◆ getWinIDEAVersion()

std::string isys::CTestReportConfig::getWinIDEAVersion ( )

Returns version of winIDEA used for running tests as set by client.

Since
9.12.288

◆ getXmlReportHeader()

std::string isys::CTestReportConfig::getXmlReportHeader ( )

Returns XML report header.

Since
9.12.288

◆ 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.
Since
9.12.288

◆ getXsltForFullReport()

std::string isys::CTestReportConfig::getXsltForFullReport ( )

Returns the name of the file to use as XML Stylesheet for the full report.

Since
9.12.288

◆ 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.
Since
9.12.288

◆ isAbsPathForLinks()

bool isys::CTestReportConfig::isAbsPathForLinks ( )

If true is returned, then links in report (for example to export files) will be written with absolute path.

Since
9.12.288

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

Since
9.12.288

◆ isCSVHeaderLine()

bool isys::CTestReportConfig::isCSVHeaderLine ( )

Returns true, if header line in CSV report format should contain names of columns.

Since
9.12.288

◆ isEmbedXsltCss()

bool isys::CTestReportConfig::isEmbedXsltCss ( )

Returns true, if XSLT and CSS files should be embedded into XML report.

Since
9.12.288

◆ isEmpty()

virtual bool isys::CTestBase::isEmpty ( ) const
virtualinherited

This method returns true, if the object contains no data.

Since
9.12.288

◆ isIncludeTestSpec()

bool isys::CTestReportConfig::isIncludeTestSpec ( )

Returns true, is test specification should be included into test report.

Since
9.12.288

◆ isSectionEmpty()

bool isys::CTestBase::isSectionEmpty ( int sectionId)
inherited

Returns true, if the given section is empty.

Since
9.12.288

◆ isSerializedAsList()

virtual bool isys::CTestBase::isSerializedAsList ( bool isParsing)
virtualinherited

Returns true if object should be serialized as list, for example CTestFunction.

Since
9.12.288

Reimplemented in isys::CTestFunction.

◆ isXLSVerticalHeader()

bool isys::CTestReportConfig::isXLSVerticalHeader ( )

Returns true, if column headers in XLS tables should be written vertically.

Since
9.12.288

◆ serialize()

virtual void isys::CTestBase::serialize ( const isys::IEmitterSPtr & emitter)
virtualinherited

Sends contents of this class to emitter.

Since
9.12.288

Reimplemented in isys::CLogResult, and isys::CTestEnvironmentConfig.

◆ setAbsPathForLinks()

void isys::CTestReportConfig::setAbsPathForLinks ( bool iaAbsPathsForLinks)

If set to true, then links in report (for example to export files) will be written with absolute path.

Since
9.12.288

◆ setComment()

virtual void isys::CTestBase::setComment ( int section,
int idx,
const std::string & nlComment,
const std::string & eolComment )
virtualinherited
Since
9.12.288

◆ setCssFile()

void isys::CTestReportConfig::setCssFile ( const std::string & cssFileName)

Sets file to be used as a style-sheet for HTML rendering.

Since
9.12.288

◆ setCsvHeaderLine()

void isys::CTestReportConfig::setCsvHeaderLine ( bool isCsvHeaderLine)

If isCsvHeaderLine is set to true, then header line with names of columns is added to CSV test report file.

Since
9.12.288

◆ setCsvSeparator()

void isys::CTestReportConfig::setCsvSeparator ( const std::string & csvSeparator)

Sets CSV separator.

Since
9.12.288

◆ setEnumTagValue()

void isys::CTestBase::setEnumTagValue ( int section,
int enumValue )
inherited

Sets value of enum type.

Since
9.12.288

◆ setFileName()

void isys::CTestReportConfig::setFileName ( const std::string & fileName)

Sets the name of the report file.

Since
9.12.288

◆ setIncludeTestSpec()

void isys::CTestReportConfig::setIncludeTestSpec ( bool isIncTestSpec)

Sets flag .

Since
9.12.288

◆ setIYamlFileName()

void isys::CTestReportConfig::setIYamlFileName ( const std::string & fileName)

Sets the name of the iyaml file, which generated this report.

Since
9.12.288

◆ setLogoImageFileName()

void isys::CTestReportConfig::setLogoImageFileName ( const std::string & logoImageFileName)

Returns file name for logo image in report.

Since
9.12.288

◆ setMainMapStyle()

virtual void isys::CTestBase::setMainMapStyle ( isys::IEmitter::EYamlStyle mappingStyle)
virtualinherited

Sets style of the mapping for complete object.

Since
9.12.288

◆ setOutputFormat()

void isys::CTestReportConfig::setOutputFormat ( EOutputFormat outFormat)

Sets report output format.

Since
9.12.288

◆ setParent()

void isys::CTestBase::setParent ( CTestBaseSPtr parent)
inherited

Sets parent.

Since
9.12.288

◆ setReportContents()

void isys::CTestReportConfig::setReportContents ( EReportContents reportContents)

Sets the type of information to be stored in the report.

Since
9.12.288

◆ setTestIDEAVersion()

void isys::CTestReportConfig::setTestIDEAVersion ( const std::string & testIDEAVersion)

Sets version of testIDEA used for running tests.

Since
9.12.288

◆ setUserInfo()

void isys::CTestReportConfig::setUserInfo ( const std::string & yamlSpec)

Sets mapping of user info, given in yaml format.

Since
9.12.288

◆ setWinIDEAVersion()

void isys::CTestReportConfig::setWinIDEAVersion ( const std::string & winIDEAVersion)

Sets version of winIDEA used for running tests.

Since
9.12.288

◆ setXLSVerticalHeader()

void isys::CTestReportConfig::setXLSVerticalHeader ( bool isXLSVerticalHeader)

Sets XLS columns headers orientation.

Since
9.12.288

◆ setXmlReportHeader()

void isys::CTestReportConfig::setXmlReportHeader ( const std::string & header)

Sets header for XML reports.

Since
9.12.288

◆ setXsltForErrors()

void isys::CTestReportConfig::setXsltForErrors ( const std::string & xsltFileName)

Sets file name for XSLT for reports, which contains errors only.

Since
9.12.288

◆ setXsltForFullReport()

void isys::CTestReportConfig::setXsltForFullReport ( const std::string & xsltFileName)

Sets file name for XSLT for full reports.

Since
9.12.288

◆ toString()

virtual std::string isys::CTestBase::toString ( )
virtualinherited

Returns object data as YAML string.

Since
9.12.288