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
):
0 test_bench = ic.CTestBench.load(
'test_min_int.iyaml', 0)
Python example.
|
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.
|
|
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.
|
|
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. More...
|
|
std::string | getWarnings () |
| If there were any warnings detected during parsing, this method returns non-empty string with description of warnings. More...
|
|
virtual bool | isEmpty () const |
| This method returns true, if the object contains no data.
|
|
void | refreshSymbolsAndGroupsIfEmpty (const CMulticoreConnectionMgrSPtr &mccmgr, const CTestEnvironmentConfigSPtr &customEnvConfig) |
| Refreshes symbols and assigns test cases to groups, if none are initialized. More...
|
|
void | save (const std::string &fileName, bool isAppend=false, bool isSaveLineNumbers=false) |
| Saves test bench configuration into the given file. More...
|
|
virtual void | serialize (const isys::IEmitterSPtr &emitter) |
| Sends contents of this class to emitter.
|
|
void | setFileName (const std::string &fileName) |
| Sets name of the file this test bench is related to. More...
|
|
virtual std::string | toString () |
| Returns object data as YAML string.
|
|
|
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: More...
|
|
static CTestBenchSPtr | cast (CTestBaseSPtr &testBase) |
| Casts the given object to this class. More...
|
|
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. More...
|
|
static void | configureStackUsage (CDataController2SPtr &dataCtrl, CTestEnvironmentConfigSPtr &runConfiguration, const std::string &coreIdParam) |
| This method configures stack usage. More...
|
|
static void | createDirIfNotExists (const std::string filePath) |
| Creates directory for the given file path, if it does not exist. More...
|
|
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. More...
|
|
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). More...
|
|
static bool | isTestWithScripts (const isys::CTestSpecificationSPtr &testSpec) |
| Returns true, if test contains scripts. More...
|
|
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. More...
|
|
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.
- Parameters
-
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. |
static void isys::CTestBench::saveTestResults |
( |
const isys::CTestReportContainerSPtr & |
testResults, |
|
|
isys::CTestReportConfigSPtr & |
reportConfig |
|
) |
| |
|
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.
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, ...).