winIDEA SDK
isys::CTestCoverage Class Reference

Description

Deprecated:
use CTestAnalyzer and CTestAnalyzerCoverage instead.

This class contains specification for coverage recording during test execution.

 

#include <CTestCoverage.h>

Inheritance diagram for isys::CTestCoverage:
isys::CTestTrace isys::CTestBase

Public Types

enum  EAnalyzerSectionId
 Ids of test specification sections.
 
enum  ERunMode {
  M_OFF , M_START ,
  M_RESUME
}
 Trace modes. More...
 

Public Member Functions

isys::CTestCoverageStatisticsSPtr addStatistics ()
 Adds empty statistics object at the end of the list.
 
void assignStatistics (const isys::CTestCoverageCSPtr &src)
 This method copies statistics data from the object given as parameter to this object.
 
CTestBaseSPtr createInstance (const CTestBaseSPtr &parent) const
 Creates new empty instance of this class. More...
 
 CTestCoverage ()
 Initializes new instance with NULL parent.
 
 CTestCoverage (const isys::CTestBaseSPtr &parent)
 Initializes new instance. More...
 
int findStatistic (const std::string &functionName)
 Returns index of statistics for the given function, or -1 if no such function exists.
 
std::string getDocumentFileName ()
 Returns name of the document to contain trace results.
 
std::string getExportFileName ()
 Returns the export file name.
 
std::string getExportFormat ()
 Returns the export format type. More...
 
std::string getExportFormatVariant ()
 Returns the export format variant. More...
 
std::string getExportFunctionsFilter ()
 Returns filter for functions export.
 
std::string getExportModulesFilter ()
 Returns filter for modules export.
 
std::string getOpenMode ()
 Returns one of the open mode strings: "r", "w", or "a".
 
ERunMode getRunMode ()
 Returns run mode.
 
isys::CTestCoverageStatisticsSPtr getStatistics (int idx)
 Returns the requested statistics. More...
 
size_t getStatisticsSize ()
 Returns vector of coverage statistic items. More...
 
std::string getTriggerName ()
 Returns the name of the trigger to be used for trace start. More...
 
void insertStatistics (isys::CTestCoverageStatisticsSPtr &stats, int idx)
 Adds empty statistics object at the end of the list.
 
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
 
iconnect::ETristate isExportAsm ()
 Returns true, if assembler coverage should be exported.
 
iconnect::ETristate isExportFunctionLines ()
 Returns true, if function lines coverage should be exported.
 
iconnect::ETristate isExportModuleLines ()
 Returns true, if module lines coverage should be exported.
 
iconnect::ETristate isExportRanges ()
 Returns true, if ranges coverage should be exported.
 
iconnect::ETristate isExportSources ()
 Returns true, if source files coverage should be exported.
 
iconnect::ETristate isLaunchViewer ()
 Returns true, if viewer should be launched after coverage.
 
bool isMerged () const
 Returns true, if the CTestSpecification section containing this object is merged. More...
 
iconnect::ETristate isProvideAssemblerInfo ()
 Returns ETrue, if assembly level coverage should be performed. More...
 
bool isRecordingConfigEmpty ()
 Returns true, if only coverage recoding configuration is empty, that means everything except statistics is empty.
 
iconnect::ETristate isSaveAfterTest ()
 Returns true, if the document should be saved after test.
 
iconnect::ETristate isSlowRun ()
 Returns E_TRUE, if slow run should be used for analyzer.
 
void removeStatistics (int idx)
 Removes statistics at the given index.
 
virtual void serialize (const isys::IEmitterSPtr &emitter)
 Sends contents of this class to emitter.
 
void setAssemblyInfo (iconnect::ETristate isAssemblyInfo)
 Sets whether assembly information should be provided with coverage. More...
 
void setCloseAfterTest (iconnect::ETristate isClose)
 Sets close operation for trace document after test.
 
void setDocumentFileName (const std::string &docFileName)
 Sets the name of the trace document.
 
void setExportAsm (iconnect::ETristate isExportAsm)
 Sets whether assembler coverage should be exported.
 
void setExportFileName (const std::string &exportFileName)
 Sets the export file name.
 
void setExportFormat (const std::string &exportFormat)
 Sets export format for the trace document. More...
 
void setExportFormatVariant (const std::string &variant)
 Sets format variant of the export format.
 
void setExportFunctionLines (iconnect::ETristate isExportFunctionLines)
 Sets whether function lines coverage should be exported.
 
void setExportFunctionsFilter (const std::string &filter)
 Sets filter for functions export.
 
void setExportModuleLines (iconnect::ETristate isExportModuleLines)
 Sets whether module lines coverage should be exported.
 
void setExportModulesFilter (const std::string &filter)
 Sets filter for modules export.
 
void setExportRanges (iconnect::ETristate isExportRanges)
 Sets whether ranges coverage should be exported.
 
void setExportSources (iconnect::ETristate isExportSources)
 Sets whether source files coverage should be exported.
 
void setLaunchViewer (iconnect::ETristate isLaunchViewer)
 Sets whether viewer should be launched after coverage.
 
void setOpenMode (const std::string &openMode)
 Sets open mode for document. More...
 
void setRunMode (ERunMode mode)
 Sets run mode.
 
void setSaveAfterTest (iconnect::ETristate isSave)
 Sets save operation for trace document after test.
 
void setSlowRun (iconnect::ETristate isSlowRun)
 If parameter is true, then slow run is used for analyzer.
 
void setTriggerName (const std::string &triggerName)
 Sets name of the trigger to be used for trace start. More...
 
void swapStatistics (int idx1, int idx2)
 Swaps two statistics in the list.
 
virtual std::string toString ()
 Returns object data as YAML string.
 

Static Public Member Functions

static CTestCoverageSPtr cast (CTestBaseSPtr &testBase)
 Casts testBase 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

◆ ERunMode

Trace modes.

Enumerator
M_OFF 

trace will not be configured or started

M_START 

start trace

M_RESUME 

Deprecated: use open mode 'a' instead, see setOpenMode().

Resumes session, currently supported only for coverage. Method setRunMode(M_RESUME) throws an exception if called on trace or profiler document.

Constructor & Destructor Documentation

◆ CTestCoverage()

isys::CTestCoverage::CTestCoverage ( 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

◆ cast()

static CTestCoverageSPtr isys::CTestCoverage::cast ( CTestBaseSPtr testBase)
static

Casts testBase to this class.

Exceptions
IllegalArgumentExceptionif cast fails.

◆ createInstance()

CTestBaseSPtr isys::CTestCoverage::createInstance ( const CTestBaseSPtr parent) const
virtual

Creates new empty instance of this class.

Can be used when we only have pointer to base but want to get instance of derived class.

Reimplemented from isys::CTestTrace.

◆ getExportFormat()

std::string isys::CTestTrace::getExportFormat ( )
inherited

Returns the export format type.

See CAnalyzerDocController for possible values.

◆ getExportFormatVariant()

std::string isys::CTestCoverage::getExportFormatVariant ( )

Returns the export format variant.

Empty string means the 'default' variant.

◆ getStatistics()

isys::CTestCoverageStatisticsSPtr isys::CTestCoverage::getStatistics ( int  idx)

Returns the requested statistics.

IMPORTANT: Pointer to object allocated by native code is returned. To avoid crashes, it is strongly recommended to copy data from this object to wrapping language object immediately after this call and then no longer use this pointer. Otherwise it may happen that parent test specification goes out of scoe and is garbage colected, while your application may still use this pointer, which is no longer valid.

◆ getStatisticsSize()

size_t isys::CTestCoverage::getStatisticsSize ( )

Returns vector of coverage statistic items.

Not accessible from other languages than C++. Returns the number of coverage statistic items.

◆ getTriggerName()

std::string isys::CTestTrace::getTriggerName ( )
inherited

Returns the name of the trigger to be used for trace start.

The trigger should be defined in winIDEA GUI.

◆ isMerged()

bool isys::CTestCoverage::isMerged ( ) const
virtual

Returns true, if the CTestSpecification section containing this object is merged.


Reimplemented from isys::CTestTrace.

◆ isProvideAssemblerInfo()

iconnect::ETristate isys::CTestCoverage::isProvideAssemblerInfo ( )

Returns ETrue, if assembly level coverage should be performed.

EDefault means that assembly level coverage will not be performed.

◆ setAssemblyInfo()

void isys::CTestCoverage::setAssemblyInfo ( iconnect::ETristate  isAssemblyInfo)

Sets whether assembly information should be provided with coverage.

Parameters
isAssemblyInfoif EDefault assembly information will not be provided with coverage.

◆ setExportFormat()

void isys::CTestTrace::setExportFormat ( const std::string &  exportFormat)
inherited

Sets export format for the trace document.

See CAnalyzerDocController for possible values.

◆ setOpenMode()

void isys::CTestTrace::setOpenMode ( const std::string &  openMode)
inherited

Sets open mode for document.

Parameters
openModecan be one of:
  • 'u' opens existing document, and updates its contents
  • 'w' creates new document or overwrites the existing one
  • 'a' opens existing document. Coverage will append its contents on start, while profiler and trace do not support appending yet.
  • empty string, which defaults to 'w'. Note that default values are NOT written to test specification file - that's why they are defaults.

◆ setTriggerName()

void isys::CTestTrace::setTriggerName ( const std::string &  triggerName)
inherited

Sets name of the trigger to be used for trace start.

The trigger must be defined in winIDEA GUI.