winIDEA SDK
isys::CTestEnvironmentConfig Class Reference

Description

This class contains configuration for winIDEA connection and logging parameters.

#include <CTestEnvironmentConfig.h>

Inheritance diagram for isys::CTestEnvironmentConfig:
isys::CTestBase

Public Types

enum  EBreakpointsType {
  EKeepWinIDEASetting , EUseHWBPs ,
  EUseSWBPs , EUseHWBPsForInitThenSWBPs
}
 These values define, how testIDEA sets breakpoints during initialization and testing. More...
 
enum  EEnvConfigSections
 Ids of test specification sections.
 

Public Member Functions

 CTestEnvironmentConfig (const CTestBaseSPtr &parent)
 Initializes new instance. More...
 
CTestBaseSPtr createInstance (const CTestBaseSPtr &parent) const
 Creates a new empty instance of this class.
 
void serialize (const isys::IEmitterSPtr &emitter) override
 Overrides base class method to change file version.
 
std::string getVersion ()
 Returns version of testIDEA which saved the test specification file.
 
std::string getWorkspace ()
 Returns workspace file path and name.
 
std::string getPrimaryCoreId ()
 Returns core ID of the primary core (the first item from the list), or empty string is there are no core IDs specified.
 
void getCoreIds (iconnect::StrVector &coreIds)
 Returns vector of core IDs. More...
 
int getCoreIdIndex (const std::string &coreId, bool isThrow)
 Returns index of the given coreId.
 
bool isUseQualifiedFuncNames ()
 Returns true, if qualified function names should be presented as content proposals in testIDEA. More...
 
std::string getAddress ()
 Returns address of remote host running winIDEA. More...
 
int getPort ()
 Returns port of remote host running winIDEA. More...
 
bool isAutoConnectToWinIDEA ()
 If true is returned, then Test Bench will connect automatically to winIDEA, when names of functions or global vars are required. More...
 
bool isAlwaysRunInitSeqBeforeRun ()
 If true, init sequence is executed before test specifications are executed. More...
 
bool isDownloadOnInit ()
 
bool isResetOnInit ()
 
bool isRunOnInit ()
 
std::string getStopFunction ()
 
bool isDeleteAllBPsOnInit ()
 
bool isCheckTargetStateBeforeRun ()
 Returns true, if testIDEA should check target state before running tests and warn user if it does not match state defined in this class, for example the target is not stopped on function 'main'.
 
bool isVerifySymbolsBeforeRun ()
 Returns true, if testIDEA should verify that functions exist on target before test run. More...
 
bool isDisableInterrupts ()
 Returns true, if interrupts should be disabled in init sequence. More...
 
int getTestTimeout ()
 Returns timeout (in milliseconds), after which test execution is terminated. More...
 
EBreakpointsType getBreakpointType ()
 Returns the type of breakpoints to be used during testing.
 
std::string getDefaultReturnValueName ()
 Returns the default name for variable, where function return value is stored.
 
std::string getAutoIdFormatString ()
 Returns string, which defines format of automatically assigned IDs. More...
 
isys::CScriptConfigSPtr getScriptConfig (bool isConst)
 Returns script configuration.
 
isys::CToolsConfigSPtr getToolsConfig (bool isConst)
 Returns tools configuration.
 
isys::CEvaluatorConfigSPtr getEvaluatorConfig (bool isConst)
 Returns evaluator configuration.
 
isys::CTestCaseTargetInitConfigSPtr getTestCaseTargetInitConfig (bool isConst)
 Returns target initialization before each test case configuration.
 
isys::CStackUsageConfigSPtr getStackUsageConfig (bool isConst)
 
isys::CTestBaseListSPtr getStackUsageOptions (bool isConst)
 Returns list of stack usage options for all cores for which it is defined.
 
void getLoggingParameters (iconnect::StrVector &params)
 Returns vector of logging parameters. More...
 
std::string getWarnings ()
 If there were any warnings detected during parsing, this method returns non-empty string with description of warnings. More...
 
void setVersion (const std::string &version)
 Outputs contents of this class to emitter. More...
 
void setWorkspace (const std::string &workspace)
 
void setAddress (const std::string &address)
 
void setPort (int port)
 
void setAutoConnectToWinIDEA (iconnect::ETristate autoConnect)
 If set to true, then Test Bench will connect automatically to winIDEA, when names of functions or global vars are required.
 
void setAlwaysRunInitSeqBeforeRun (iconnect::ETristate isAlwaysRunInitSeq)
 If set to true, init sequence is run before each test start.
 
void setDownloadOnInit (iconnect::ETristate isDownload)
 
void setResetOnInit (iconnect::ETristate isReset)
 
void setRunOnInit (iconnect::ETristate isRun)
 
void setStopFunction (const std::string &stopFunction)
 
void setDeleteAllBPsOnInit (iconnect::ETristate isDeleteAllBPs)
 
void setCheckTargetStateBeforeRun (iconnect::ETristate isCheckTargetState)
 Defines, if testIDEA should check target state before running tests. More...
 
void setVerifySymbolsBeforeRun (iconnect::ETristate isVerifySymbols)
 Defines, if testIDEA should verify symbols before test run. More...
 
void setDisableInterrupts (iconnect::ETristate isDisableInterrupts)
 
void setTestTimeout (int timeout)
 Sets timeout (in milliseconds), after which test execution is terminated. More...
 
void setBreakpointsType (EBreakpointsType breakpointsType)
 Sets type of breakpoints to be used in testing.
 
void setDefaultReturnValueName (const std::string &defaultRetValName)
 Sets default name for variable, where function return value is stored.
 
void setAutoIdFormatString (const std::string &format)
 Sets format of automatically assigned IDs. More...
 
void setLoggingParameters (const std::string &params)
 Sets logging parameters. More...
 
std::string getConfiguredCoreID (const std::string &testCaseCoreId)
 Returns the given testCaseCoreId, if it is not empty. More...
 
virtual bool isEmpty () const
 This method returns true, if the object contains no data.
 
virtual std::string toString ()
 Returns object data as YAML string.
 

Static Public Member Functions

static CTestEnvironmentConfigSPtr cast (const CTestBaseSPtr &testBase)
 Casts the given object to this class. More...
 
static std::string getStaticVersion ()
 This method may be used by other classes during parsing to obtain version of currently parsed iyaml file. 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

◆ EBreakpointsType

These values define, how testIDEA sets breakpoints during initialization and testing.

Enumerator
EKeepWinIDEASetting 

testIDEA does not change setting in winIDEA

EUseHWBPs 

testIDEA configures winIDEA to use hardware breakpoints

EUseSWBPs 

testIDEA configures winIDEA to use software breakpoints

EUseHWBPsForInitThenSWBPs 

testIDEA configures winIDEA to use hardware breakpoints during target initialization phase, and software breakpoints during testing.

This setting is useful, when target init involves for example CRC verification of code, which fails in case of software breakpoints.

Constructor & Destructor Documentation

◆ CTestEnvironmentConfig()

isys::CTestEnvironmentConfig::CTestEnvironmentConfig ( const 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 CTestEnvironmentConfigSPtr isys::CTestEnvironmentConfig::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.

◆ getAddress()

std::string isys::CTestEnvironmentConfig::getAddress ( )

Returns address of remote host running winIDEA.

If empty string is returned and port is 0, then local host is used.

◆ getAutoIdFormatString()

std::string isys::CTestEnvironmentConfig::getAutoIdFormatString ( )

Returns string, which defines format of automatically assigned IDs.

See also
setAutoIdFormatString

◆ getConfiguredCoreID()

std::string isys::CTestEnvironmentConfig::getConfiguredCoreID ( const std::string &  testCaseCoreId)

Returns the given testCaseCoreId, if it is not empty.

If it is empty, the first item from envConfig core IDs is returned. If no core IDs are defined there, an empty string is returned.

◆ getCoreIds()

void isys::CTestEnvironmentConfig::getCoreIds ( iconnect::StrVector coreIds)

Returns vector of core IDs.

If empty, single core is used with empty string as its ID.

◆ getLoggingParameters()

void isys::CTestEnvironmentConfig::getLoggingParameters ( iconnect::StrVector params)

Returns vector of logging parameters.

Parameters are stored in the list in the following order: logFileName, logObjPrefix. All parameters are optional. If none of them is specified, logging is off.

◆ getPort()

int isys::CTestEnvironmentConfig::getPort ( )

Returns port of remote host running winIDEA.

If 0 is returned and address is empty string, then local host is used.

◆ getStackUsageConfig()

isys::CStackUsageConfigSPtr isys::CTestEnvironmentConfig::getStackUsageConfig ( bool  isConst)
Deprecated:
use getStackUsageOptions() instead

Returns configuration for stack usage measurements.

◆ getStaticVersion()

static std::string isys::CTestEnvironmentConfig::getStaticVersion ( )
static

This method may be used by other classes during parsing to obtain version of currently parsed iyaml file.

If the version was not parsed, empty string is returned.

◆ getStopFunction()

std::string isys::CTestEnvironmentConfig::getStopFunction ( )
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then get action from CInitSequence.

Returns the name of the function to stop on in init sequence. Has no effect if isRunOnInit() returns false.

◆ getTestTimeout()

int isys::CTestEnvironmentConfig::getTestTimeout ( )

Returns timeout (in milliseconds), after which test execution is terminated.

Value 0 means infinite timeout. This timeout value is overridden, if timeout is specified in test case.

◆ getWarnings()

std::string isys::CTestEnvironmentConfig::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()

◆ isAlwaysRunInitSeqBeforeRun()

bool isys::CTestEnvironmentConfig::isAlwaysRunInitSeqBeforeRun ( )

If true, init sequence is executed before test specifications are executed.

Default value (E_DEFAULT) means false.

◆ isAutoConnectToWinIDEA()

bool isys::CTestEnvironmentConfig::isAutoConnectToWinIDEA ( )

If true is returned, then Test Bench will connect automatically to winIDEA, when names of functions or global vars are required.

Default value (E_DEFAULT) means false.

◆ isDeleteAllBPsOnInit()

bool isys::CTestEnvironmentConfig::isDeleteAllBPsOnInit ( )
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then get action from CInitSequence.

Returns true, if all breakpoints should be deleted in init sequence. Default value (E_DEFAULT) means false.

◆ isDisableInterrupts()

bool isys::CTestEnvironmentConfig::isDisableInterrupts ( )

Returns true, if interrupts should be disabled in init sequence.

Default value (E_DEFAULT) means false.

◆ isDownloadOnInit()

bool isys::CTestEnvironmentConfig::isDownloadOnInit ( )
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then get action from CInitSequence.

If true, download is performed in init sequence. Default value (E_DEFAULT) means false.

◆ isResetOnInit()

bool isys::CTestEnvironmentConfig::isResetOnInit ( )
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then get action from CInitSequence.

If true, reset is performed in init sequence. Default value (E_DEFAULT) means false.

◆ isRunOnInit()

bool isys::CTestEnvironmentConfig::isRunOnInit ( )
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then get action from CInitSequence.

If true, target is started in init sequence. Default value (E_DEFAULT) means false.

◆ isUseQualifiedFuncNames()

bool isys::CTestEnvironmentConfig::isUseQualifiedFuncNames ( )

Returns true, if qualified function names should be presented as content proposals in testIDEA.

Default value (E_DEFAULT) means false.

◆ isVerifySymbolsBeforeRun()

bool isys::CTestEnvironmentConfig::isVerifySymbolsBeforeRun ( )

Returns true, if testIDEA should verify that functions exist on target before test run.

If non-existent functions are found in test cases, pop-up dialog appears in testIDEA.

◆ setAddress()

void isys::CTestEnvironmentConfig::setAddress ( const std::string &  address)
See also
getAddress

◆ setAutoIdFormatString()

void isys::CTestEnvironmentConfig::setAutoIdFormatString ( const std::string &  format)

Sets format of automatically assigned IDs.

The string format is specific to the tool, which applies IDs. See testIDEA help for testIDEA rules. Users may write their own scripts, which may specify custom formats.

The string can be composed of variables and plain text between them. Variables have the following format: ${<var>}. The following variables are available:

  • ${id[,n[,m]]} - generates unique string ID. Optional value n defines the number of characters for the ID. Optional value m defines the number of characters for the ID extension of derived tests. If m is specified, IDs of derived tests are formed as [base test ID].[derived test id]. Letters, numbers and '.' are used in the ID string.
  • ${seq[,n[,m]]} - generates IDs, which are the same as test case sequence number. The first test gets number 0, the next one number 1, ... Optional value n defines the number of characters for the ID. Optional value m defines the number of characters for the ID extension of derived tests. If m is specified, IDs of derived tests are formed as [base test ID].[derived test id]. Only numbers and '.' are used in the ID string.
  • ${function} - name of the function under test.
  • ${params} - values of parameters. Values of parameters are separated by '-' sign, all characters, which are not allowed for test ID are replaced with '_'
  • ${tags} - test tags separated by '-'.

Example format string:

"/{$id,4}/${function}-${params}-${tags}

◆ setCheckTargetStateBeforeRun()

void isys::CTestEnvironmentConfig::setCheckTargetStateBeforeRun ( iconnect::ETristate  isCheckTargetState)

Defines, if testIDEA should check target state before running tests.

For example, if run until function is specified in init sequence, testIDEA checks if target is stopped there.

See also
isCheckTargetStateBeforeRun

◆ setDeleteAllBPsOnInit()

void isys::CTestEnvironmentConfig::setDeleteAllBPsOnInit ( iconnect::ETristate  isDeleteAllBPs)
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then set action in CInitSequence.
See also
isDeleteAllBPsOnInit

◆ setDisableInterrupts()

void isys::CTestEnvironmentConfig::setDisableInterrupts ( iconnect::ETristate  isDisableInterrupts)

◆ setDownloadOnInit()

void isys::CTestEnvironmentConfig::setDownloadOnInit ( iconnect::ETristate  isDownload)
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then set action in CInitSequence. This function should not be used for multicore init sequences, because order of actions can not be specified.
See also
isDownloadOnInit

◆ setLoggingParameters()

void isys::CTestEnvironmentConfig::setLoggingParameters ( const std::string &  params)

Sets logging parameters.

Parameters are stored in the list in the following order: [logFileName, logObjPrefix]. All parameters are optional. If none of them is specified, logging is off.

◆ setPort()

void isys::CTestEnvironmentConfig::setPort ( int  port)
See also
getPort

◆ setResetOnInit()

void isys::CTestEnvironmentConfig::setResetOnInit ( iconnect::ETristate  isReset)
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then set action in CInitSequence.
See also
isResetOnInit

◆ setRunOnInit()

void isys::CTestEnvironmentConfig::setRunOnInit ( iconnect::ETristate  isRun)
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then set action in CInitSequence.
See also
isRunOnInit

◆ setStopFunction()

void isys::CTestEnvironmentConfig::setStopFunction ( const std::string &  stopFunction)
Deprecated:
use getTestBaseList(E_SECTION_INIT_SEQUENCE) and then set action in CInitSequence.
See also
getStopFunction

◆ setTestTimeout()

void isys::CTestEnvironmentConfig::setTestTimeout ( int  timeout)

Sets timeout (in milliseconds), after which test execution is terminated.

Value 0 means infinite timeout. This timeout value is overridden, if timeout is specified in test case.

◆ setVerifySymbolsBeforeRun()

void isys::CTestEnvironmentConfig::setVerifySymbolsBeforeRun ( iconnect::ETristate  isVerifySymbols)

Defines, if testIDEA should verify symbols before test run.

It checks if all functions (tested, stubs, ...) exist on target.

◆ setVersion()

void isys::CTestEnvironmentConfig::setVersion ( const std::string &  version)

Outputs contents of this class to emitter.

See also
getVersion

◆ setWorkspace()

void isys::CTestEnvironmentConfig::setWorkspace ( const std::string &  workspace)
See also
getWorkspace