winIDEA SDK
isys::CTestFilterController Class Reference

Description

This class maintains all data required for test case filtering, and contains methods, which perform the filtering.

It maintains the following structure of symbols: coreInfo --> partition1 --> module1 --> func1 func2 ... module2 ... partition2 --> moduleN

partition3 ...

#include <CTestFilterController.h>

Public Member Functions

bool isEmpty ()
 Returns true, if there are no symbols stored in this object.
 
void clear ()
 Clears symbols. More...
 
int countExecutableTests (const isys::CTestSpecificationSPtr &testSpec, int derivedLevel, const isys::CTestFilterSPtr &testFilter)
 Returns the number of tests which are executable (have 'run' flag set and are note excluded by the given filter. More...
 
bool isTestExecutable (const isys::CTestSpecificationSPtr &testSpec, const isys::CTestFilterSPtr &testFilter)
 Returns true, if the test will be executed. More...
 
void setDefaultCoreId (const std::string &coreId)
 Sets list of core IDs.
 
void setDefaultPartition (const std::string &coreId, const std::string &defaultPartition)
 Used for assigning test cases to groups. More...
 
void setFunctionToModuleMap (const std::string &coreId, iconnect::StrStrMap &functionToModuleMap)
 Sets map with keys containing function name with partition, and modules as values. More...
 
bool filterTestSpec (const isys::CTestSpecificationSPtr &testSpec, bool isTestSpecMerged, const isys::CTestFilterSPtr &filter)
 Returns true, if testSpec passes filter, false otherwise. More...
 
std::string getTestItemsForFilter (const CTestGroupSPtr &testGroup, iconnect::StrVector &partitions, iconnect::StrVector &modules, iconnect::StrVector &qualFuncNames)
 Returns all partitions, modules, and functions for coreID from filter, which pass filter. More...
 
void countTestCasesInGroup (const CTestGroupSPtr &group, iconnect::StrSet &partitionsWTestInGroup, iconnect::StrSet &modulesWTestInGroup, iconnect::StrSet &functionsWTestInGroup)
 Based on filter from the given group, this m. More...
 
std::string toString ()
 Prints stored symbol information.
 

Member Function Documentation

◆ clear()

void isys::CTestFilterController::clear ( )

Clears symbols.

Can be used to indicate that refresh is needed.

◆ countExecutableTests()

int isys::CTestFilterController::countExecutableTests ( const isys::CTestSpecificationSPtr &  testSpec,
int  derivedLevel,
const isys::CTestFilterSPtr &  testFilter 
)

Returns the number of tests which are executable (have 'run' flag set and are note excluded by the given filter.

Parameters
testSpecthe test spec. and it's derived test specs to be counted
derivedLevelhow deep to test derived test specifications
testFilterfilter to be used for test inclusion/exclusion. If the filter specifies script function, an IllegalStateException is thrown, since scripts can't be called from native code.

◆ countTestCasesInGroup()

void isys::CTestFilterController::countTestCasesInGroup ( const CTestGroupSPtr &  group,
iconnect::StrSet partitionsWTestInGroup,
iconnect::StrSet modulesWTestInGroup,
iconnect::StrSet functionsWTestInGroup 
)

Based on filter from the given group, this m.

returns all partitions, modules, and functions, which are tested by at least one test case in a group.

◆ filterTestSpec()

bool isys::CTestFilterController::filterTestSpec ( const isys::CTestSpecificationSPtr &  testSpec,
bool  isTestSpecMerged,
const isys::CTestFilterSPtr &  filter 
)

Returns true, if testSpec passes filter, false otherwise.

Parameters
testSpectest specification to be filtered
isTestSpecMergedif the given test spec is already merged, then specifying this flag as True saves some time. If false, the given test spec is merged before filter is applied.
filtercontains data to be used for filtering

◆ getTestItemsForFilter()

std::string isys::CTestFilterController::getTestItemsForFilter ( const CTestGroupSPtr &  testGroup,
iconnect::StrVector partitions,
iconnect::StrVector modules,
iconnect::StrVector qualFuncNames 
)

Returns all partitions, modules, and functions for coreID from filter, which pass filter.

Parameters
testGrouptest group.
partitionsvector to receive partition names.
modulesvector to receive module names.
qualFuncNamesvector to receive qualified function names with module paths.
Returns
empty string if everything OK, warning or error otherwise (for example core ID not found, not all partitions in filter exist in core).

◆ isTestExecutable()

bool isys::CTestFilterController::isTestExecutable ( const isys::CTestSpecificationSPtr &  testSpec,
const isys::CTestFilterSPtr &  testFilter 
)

Returns true, if the test will be executed.

This method is similar to filterTestSpec(), but always performs merging.

Parameters
testSpecthe test spec. to be tested for execution
testFilterfilter to be used for test inclusion/exclusion. If the filter specifies script function, an IllegalStateException is thrown, since scripts can't be called from native code.

◆ setDefaultPartition()

void isys::CTestFilterController::setDefaultPartition ( const std::string &  coreId,
const std::string &  defaultPartition 
)

Used for assigning test cases to groups.

You can use CIDEController::getDefaultDownloadFile() to obtain this value.

Parameters
coreIdcore ID.
defaultPartitionname of default download file as set in winIDEA.

◆ setFunctionToModuleMap()

void isys::CTestFilterController::setFunctionToModuleMap ( const std::string &  coreId,
iconnect::StrStrMap functionToModuleMap 
)

Sets map with keys containing function name with partition, and modules as values.

You can use CDataController::getFunctionToModuleMap() to obtain this information.

Parameters
coreIdcore ID.
functionToModuleMapfunction name to module name, for example: main,,sample.elf: main.c