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.
|
isys::CTestEnvironmentConfigSPtr | getTestEnvironmentConfig (bool isConst) |
| Returns test environment configuration.
|
|
isys::CTestReportConfigSPtr | getTestReportConfig (bool isConst) |
| Returns test report configuration.
|
|
isys::CTestBaseListSPtr | getTestFilters (bool isConst) |
| Returns test filters.
|
|
isys::CTestFilterSPtr | getTestFilter (const std::string &filterId) |
| Returns test filter with the given ID, or NULL if the filter is not found.
|
|
isys::CTestGroupSPtr | getGroup (bool isConst) |
| Returns root group.
|
|
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...
|
|
std::string | getFileName () |
| Returns file from which this test bench data was loaded, or saved to.
|
|
void | setFileName (const std::string &fileName) |
| Sets name of the file this test bench is related to. More...
|
|
std::string | getModelDirectory () |
| Returns directory of the model file.
|
|
void | save (const std::string &fileName, bool isAppend=false, bool isSaveLineNumbers=false) |
| Saves test bench configuration into the given file. More...
|
|
isys::CTestReportContainerSPtr | getTestReportContainer () |
| Returns instance of class containing information for test reports.
|
|
isys::CTestFilterControllerSPtr | getFilterController () |
| Returns reference to filter controller.
|
|
void | refreshSymbolsAndGroupsIfEmpty (const CMulticoreConnectionMgrSPtr &mccmgr, const CTestEnvironmentConfigSPtr &customEnvConfig) |
| Refreshes symbols and assigns test cases to groups, if none are initialized. More...
|
|
virtual bool | isEmpty () const |
| This method returns true, if the object contains no data.
|
|
virtual void | serialize (const isys::IEmitterSPtr &emitter) |
| Sends contents of this class to emitter.
|
|
virtual std::string | toString () |
| Returns object data as YAML string.
|
|
|
static CTestBenchSPtr | cast (CTestBaseSPtr &testBase) |
| Casts the given object to this class. 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 | 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 void | createDirIfNotExists (const std::string filePath) |
| Creates directory for the given file path, if it does not exist. More...
|
|
static void | saveTestResults (const isys::CTestReportContainerSPtr &testResults, isys::CTestReportConfigSPtr &reportConfig) |
| This method saves test results into file in the specified format. 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 | 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 | 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 bool | isTestWithScripts (const isys::CTestSpecificationSPtr &testSpec) |
| Returns true, if test contains scripts. 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, ...).