This class encapsulates all data required to run isystem unit tests. More...
#include <CTestBench.h>
Public Types | |
| enum | ETestBenchSectionIds |
| Ids of test specification sections. | |
Public Member Functions | |
| virtual void | assign (const CTestObjectSPtr &base) |
| Assigns members of base to this. | |
| void | calculateGroupResults (const CMulticoreConnectionMgrSPtr &mcmgr, const CTestEnvironmentConfigSPtr &envConfig) |
| 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 |
| CTestBaseSPtr | createTestBase (int section, size_t lineNo=IEmitter::LINE_NUM_NOT_SET) const |
| CTestBench () | |
| std::string | getClassName () const |
| virtual CTestTreeNodeSPtr | getContainerTestNode () |
| virtual CTestSpecificationSPtr getContainerTestSpec(); | |
| int | getEnumTagValue (int section) |
| Returns value of enum type. | |
| std::string | getFileName () |
| Returns file from which this test bench data was loaded, or saved to. | |
| isys::CTestFilterControllerSPtr | getFilterController () |
| Returns reference to filter controller. | |
| isys::CTestGroupSPtr | getGroup (bool isConst) |
| Returns root group. | |
| std::string | getModelDirectory () |
| Returns directory of the model file. | |
| CTestBaseSPtr | getParent () const |
| Returns parent. | |
| int | getSectionId (const std::string §ionName) |
| Returns section ID for the given section name. | |
| CTestBaseSPtr | getTestBase (int section, bool isConst) |
| CTestBaseListSPtr | getTestBaseList (int section, bool isConst) |
| isys::CTestEnvironmentConfigSPtr | getTestEnvironmentConfig (bool isConst) |
| Returns test environment configuration. | |
| isys::CTestFilterSPtr | getTestFilter (const std::string &filterId) |
| Returns test filter with the given ID, or NULL if the filter is not found. | |
| isys::CTestBaseListSPtr | getTestFilters (bool isConst) |
| Returns test filters. | |
| CTestObject::ETestObjType | getTestObjType () const |
| Returns type of this object, which is CTestObject::ETestBase. | |
| isys::CTestReportConfigSPtr | getTestReportConfig (bool isConst) |
| Returns test report configuration. | |
| isys::CTestReportContainerSPtr | getTestReportContainer () |
| Returns instance of class containing information for test reports. | |
| isys::CTestSpecificationSPtr | getTestSpecification (bool isConst) |
| Returns root test case. | |
| std::string | getWarnings () |
| If there were any warnings detected during parsing, this method returns non-empty string with description of warnings. | |
| virtual bool | isEmpty () const |
| This method returns true, if the object contains no data. | |
| 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. | |
| void | refreshSymbolsAndGroupsIfEmpty (const CMulticoreConnectionMgrSPtr &mccmgr, const CTestEnvironmentConfigSPtr &customEnvConfig) |
| Refreshes symbols and assigns test cases to groups, if none are initialized. | |
| void | save (const std::string &fileName, bool isAppend=false, bool isSaveLineNumbers=false) |
| Saves test bench configuration into the given file. | |
| virtual void | serialize (const isys::IEmitterSPtr &emitter) |
| Sends contents of this class to emitter. | |
| virtual void | setComment (int section, int idx, const std::string &nlComment, const std::string &eolComment) |
| void | setEnumTagValue (int section, int enumValue) |
| Sets value of enum type. | |
| void | setFileName (const std::string &fileName) |
| Sets name of the file this test bench is related to. | |
| virtual void | setMainMapStyle (isys::IEmitter::EYamlStyle mappingStyle) |
| Sets style of the mapping for complete object. | |
| void | setParent (CTestBaseSPtr parent) |
| Sets parent. | |
| void | setTestSpecification (isys::CTestSpecificationSPtr &testSpec) |
| Assigns root test specification. | |
| virtual std::string | toString () |
| Returns object data as YAML string. | |
Static Public Member Functions | |
| static void | addUserInfoToReportConfig (const isys::CTestReportConfigSPtr &reportConfig, const std::string &testSpecificationFile, const std::string &winIDEAWorkspace, const std::string &winIDEAWorkspaceFile, const std::string &defaultDlFile) |
| This method adds the following info to report config: | |
| static CTestBenchSPtr | cast (CTestBaseSPtr &testBase) |
| Casts the given object to this class. | |
| static void | configureBreakpointsMode (isys::CIDEControllerSPtr &ideCtrl, isys::CTestEnvironmentConfig::EBreakpointsType bpType, int coreIdx, bool isBeforeInit) |
| This method configures type of breakpoints (software of hardware) as needed for target initialization. | |
| static void | configureStackUsage (CDataController2SPtr &dataCtrl, CTestEnvironmentConfigSPtr &runConfiguration, const std::string &coreIdParam) |
| This method configures stack usage. | |
| static void | createDirIfNotExists (const std::string filePath) |
| Creates directory for the given file path, if it does not exist. | |
| static bool | execTestCaseInitSequence (isys::CTestCaseTargetInitConfigSPtr &testCaseInitConfig, isys::ConnectionMgrSPtr &connectionMgr, isys::CDebugFacadeSPtr &debug, int targetStopTimeout, bool isTestBatchOn) |
| This function initializes target before execution of each test case. | |
| static void | initTargetForTest (isys::CTestEnvironmentConfigSPtr &config, isys::CDebugFacadeSPtr &debug, isys::CIDEControllerSPtr &ideCtrl, int targetStopTimeout) |
| Deprecated since 9.12.188, 2014-09-05, it works for old style init sequences only (download, reset, run, and runUntil actions are supported only and only in this order, no multicore support). | |
| static bool | isTestWithScripts (const isys::CTestSpecificationSPtr &testSpec) |
| Returns true, if test contains scripts. | |
| static CTestBenchSPtr | load (const std::string &fileName, size_t filePos=0) |
| Loads test environment configuration and test specifications from the given file. | |
| static CTestBenchSPtr | parse (const std::string &yamlSpec) |
| Parses test environment configuration and test specifications from the given string. | |
| static void | saveTestResults (const isys::CTestReportContainerSPtr &testResults, isys::CTestReportConfigSPtr &reportConfig) |
| This method saves test results into file in the specified format. | |
Protected Member Functions | |
| void | setStaticTagsAsConst () |
| This method is called by all objects which are immediately contained in CTestSpecification, for example CTestCoverage, CTestHIL, ... | |
This class encapsulates all data required to run isystem unit tests.
Use one of static methods to get instances of this class.
Python example (from filterTests.py):
Python example: filter_tests.py
| isys::CTestBench::CTestBench | ( | ) |
|
static |
This method adds the following info to report config:
|
virtualinherited |
| void isys::CTestBench::calculateGroupResults | ( | const CMulticoreConnectionMgrSPtr & | mcmgr, |
| const CTestEnvironmentConfigSPtr & | envConfig ) |
|
static |
Casts the given object to this class.
Returns NULL if input is NULL.
| IllegalArgumentException | if input object is not instance of this class. |
|
static |
This method configures type of breakpoints (software of hardware) as needed for target initialization.
| ideCtrl | controller object needed to access winIDEA |
| bpType | type of breakpoints |
| coreIdx | index of core for BP configuration |
| isBeforeInit | should be true, when this method is called before init sequence, false when it is called for the second time after init seq. |
|
static |
This method configures stack usage.
| dataCtrl | controller object needed to access winIDEA |
| runConfiguration | object containing stack measurement configurations |
| coreIdParam | id of core for which stack usage measurement should be configured. |
|
inherited |
Returns true, if the specified section exists for this object.
|
virtualinherited |
Creates a deep copy of this object.
Parent is set.
|
static |
Creates directory for the given file path, if it does not exist.
If path does not contain file name, it must end with path separator.
|
virtual |
Implements isys::CTestBase.
|
virtual |
Reimplemented from isys::CTestBase.
|
static |
This function initializes target before execution of each test case.
| testCaseInitConfig | initialization configuration |
| connectionMgr | ConnectionMgr with connection to winIDEA instance to initialize. |
| debug | debug facade |
| targetStopTimeout | timeout in milliseconds to wait for target to stop on the given function, address or breakpoint. TimeoutException is thrown in case of timeout. |
| isTestBatchOn | true test batch is on. |
|
inherited |
|
virtualinherited |
virtual CTestSpecificationSPtr getContainerTestSpec();
|
inherited |
Returns value of enum type.
| std::string isys::CTestBench::getFileName | ( | ) |
Returns file from which this test bench data was loaded, or saved to.
| isys::CTestFilterControllerSPtr isys::CTestBench::getFilterController | ( | ) |
Returns reference to filter controller.
| isys::CTestGroupSPtr isys::CTestBench::getGroup | ( | bool | isConst | ) |
Returns root group.
| std::string isys::CTestBench::getModelDirectory | ( | ) |
Returns directory of the model file.
|
inherited |
Returns parent.
|
inherited |
Returns section ID for the given section name.
|
inherited |
|
inherited |
| isys::CTestEnvironmentConfigSPtr isys::CTestBench::getTestEnvironmentConfig | ( | bool | isConst | ) |
Returns test environment configuration.
| isys::CTestFilterSPtr isys::CTestBench::getTestFilter | ( | const std::string & | filterId | ) |
Returns test filter with the given ID, or NULL if the filter is not found.
| isys::CTestBaseListSPtr isys::CTestBench::getTestFilters | ( | bool | isConst | ) |
Returns test filters.
|
inherited |
Returns type of this object, which is CTestObject::ETestBase.
| isys::CTestReportConfigSPtr isys::CTestBench::getTestReportConfig | ( | bool | isConst | ) |
Returns test report configuration.
| isys::CTestReportContainerSPtr isys::CTestBench::getTestReportContainer | ( | ) |
Returns instance of class containing information for test reports.
| isys::CTestSpecificationSPtr isys::CTestBench::getTestSpecification | ( | bool | isConst | ) |
Returns root test case.
This test case is a container only - it has no data set, but contains derived test cases (as they were defined in testIDEA, for example).
| std::string isys::CTestBench::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. This method calls getWarning() on all aggregated classes, so it is not necessary to call getWarning() on each of them.
|
static |
Deprecated since 9.12.188, 2014-09-05, it works for old style init sequences only (download, reset, run, and runUntil actions are supported only and only in this order, no multicore support).
Call 'executeInitAction' for all init actions in CTestEnvironmentConfig instead. Python has method PTestCase.executeInitSequence(), which replaces this method.
Initializes target according to settings in 'config' to be ready for unit tests.
| config | initialization configuration |
| debug | debug facade |
| ideCtrl | ide controller |
| targetStopTimeout | timeout in milliseconds to wait for target to stop on the given function, address or breakpoint. TimeoutException is thrown in case of timeout. |
|
virtualinherited |
This method returns true, if the object contains no data.
|
inherited |
Returns true, if the given section is empty.
|
virtualinherited |
Returns true if object should be serialized as list, for example CTestFunction.
Reimplemented in isys::CTestFunction.
|
static |
Returns true, if test contains scripts.
| testSpec | the test spec. to be tested for usage of scripts |
| void isys::CTestBench::refreshSymbolsAndGroupsIfEmpty | ( | const CMulticoreConnectionMgrSPtr & | mccmgr, |
| const CTestEnvironmentConfigSPtr & | customEnvConfig ) |
Refreshes symbols and assigns test cases to groups, if none are initialized.
To refresh possibly existing symbols in this object, first call: testBench.getFilterController().clear(); and then this method.
| mccmgr | connection object |
| customEnvConfig | if you want to specify custom coreIds. If null, then object returned by call to getTestEnvironmentConfig(true) is used. |
| void isys::CTestBench::save | ( | const std::string & | fileName, |
| bool | isAppend = false, | ||
| bool | isSaveLineNumbers = false ) |
Saves test bench configuration into the given file.
| fileName | file to save to |
| isAppend | if true, new data is appended to the end of the file, otherwise any previous contents is erased. |
| isSaveLineNumbers | if true, line numbers are assigned to test specifications when saved |
|
static |
This method saves test results into file in the specified format.
Only XML, YAML and CSV files are supported by this function. XLS and XLSX (Excel) formats are available only from testIDEA, but CSV format can be easily imported to Excel.
Note for CSV format: Because there are three different tables stored (configuration, statistics, and results), three files are created for CSV format. File name specified in reportConfig gets appended '-config' and '-statistics' strings for configuration and statistics tables respectively.
Python example: create_test_report.py
|
virtualinherited |
Sends contents of this class to emitter.
Reimplemented in isys::CLogResult, and isys::CTestEnvironmentConfig.
|
virtualinherited |
|
inherited |
Sets value of enum type.
| void isys::CTestBench::setFileName | ( | const std::string & | fileName | ) |
Sets name of the file this test bench is related to.
It should be always absolute, as this directory is considered as working directory, when relative path names are specified for other files in test spec (reports, diagrams, ...).
|
virtualinherited |
Sets style of the mapping for complete object.
|
inherited |
Sets parent.
| void isys::CTestBench::setTestSpecification | ( | isys::CTestSpecificationSPtr & | testSpec | ) |
Assigns root test specification.
|
virtualinherited |
Returns object data as YAML string.