winIDEA SDK
|
This class contains configuration for winIDEA connection and logging parameters.
#include <CTestEnvironmentConfig.h>
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 ¶ms) |
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 ¶ms) |
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, ... | |
These values define, how testIDEA sets breakpoints during initialization and testing.
isys::CTestEnvironmentConfig::CTestEnvironmentConfig | ( | const CTestBaseSPtr & | parent | ) |
Initializes new instance.
parent | an instance of parent CTestSpecification class. Used only when parsing YAML declaration. Can be specified as NULL if the object is not initialized by parser. |
|
static |
Casts the given object to this class.
Returns NULL if input is NULL.
IllegalArgumentException | if input object is not instance of this class. |
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.
std::string isys::CTestEnvironmentConfig::getAutoIdFormatString | ( | ) |
Returns string, which defines format of automatically assigned IDs.
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.
void isys::CTestEnvironmentConfig::getCoreIds | ( | iconnect::StrVector & | coreIds | ) |
Returns vector of core IDs.
If empty, single core is used with empty string as its ID.
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.
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.
isys::CStackUsageConfigSPtr isys::CTestEnvironmentConfig::getStackUsageConfig | ( | bool | isConst | ) |
Returns configuration for stack usage measurements.
|
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.
std::string isys::CTestEnvironmentConfig::getStopFunction | ( | ) |
Returns the name of the function to stop on in init sequence. Has no effect if isRunOnInit() returns false.
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.
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.
bool isys::CTestEnvironmentConfig::isAlwaysRunInitSeqBeforeRun | ( | ) |
If true, init sequence is executed before test specifications are executed.
Default value (E_DEFAULT) means false.
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.
bool isys::CTestEnvironmentConfig::isDeleteAllBPsOnInit | ( | ) |
Returns true, if all breakpoints should be deleted in init sequence. Default value (E_DEFAULT) means false.
bool isys::CTestEnvironmentConfig::isDisableInterrupts | ( | ) |
Returns true, if interrupts should be disabled in init sequence.
Default value (E_DEFAULT) means false.
bool isys::CTestEnvironmentConfig::isDownloadOnInit | ( | ) |
If true, download is performed in init sequence. Default value (E_DEFAULT) means false.
bool isys::CTestEnvironmentConfig::isResetOnInit | ( | ) |
If true, reset is performed in init sequence. Default value (E_DEFAULT) means false.
bool isys::CTestEnvironmentConfig::isRunOnInit | ( | ) |
If true, target is started in init sequence. Default value (E_DEFAULT) means false.
bool isys::CTestEnvironmentConfig::isUseQualifiedFuncNames | ( | ) |
Returns true, if qualified function names should be presented as content proposals in testIDEA.
Default value (E_DEFAULT) means false.
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.
void isys::CTestEnvironmentConfig::setAddress | ( | const std::string & | address | ) |
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:
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.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.Example format string:
"/{$id,4}/${function}-${params}-${tags}
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.
void isys::CTestEnvironmentConfig::setDeleteAllBPsOnInit | ( | iconnect::ETristate | isDeleteAllBPs | ) |
void isys::CTestEnvironmentConfig::setDisableInterrupts | ( | iconnect::ETristate | isDisableInterrupts | ) |
void isys::CTestEnvironmentConfig::setDownloadOnInit | ( | iconnect::ETristate | isDownload | ) |
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.
void isys::CTestEnvironmentConfig::setPort | ( | int | port | ) |
void isys::CTestEnvironmentConfig::setResetOnInit | ( | iconnect::ETristate | isReset | ) |
void isys::CTestEnvironmentConfig::setRunOnInit | ( | iconnect::ETristate | isRun | ) |
void isys::CTestEnvironmentConfig::setStopFunction | ( | const std::string & | stopFunction | ) |
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.
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.
void isys::CTestEnvironmentConfig::setVersion | ( | const std::string & | version | ) |
Outputs contents of this class to emitter.
void isys::CTestEnvironmentConfig::setWorkspace | ( | const std::string & | workspace | ) |