winIDEA SDK
isys::CTestFilter Class Reference

Description

This class defies conditions, which test case must satisfy to be executed.


#include <CTestFilter.h>

Inheritance diagram for isys::CTestFilter:
isys::CTestBase

Public Types

enum  EFilterTypes { BUILT_IN_FILTER , SCRIPT_FILTER }
 Defines built-in and script filters. More...
 
enum  ETestFilterSectionIds
 Ids of test specification sections.
 

Public Member Functions

 CTestFilter (const CTestBaseSPtr &parent)
 Initializes new instance. More...
 
EFilterTypes getFilterType ()
 Returns true, if script function is set.
 
std::string getFilterId ()
 Returns the ID of this filter.
 
std::string getCoreId ()
 Returns core or application ID.
 
void getPartitions (iconnect::StrVector &partitions)
 Returns regex for partition names (download file) where symbols are located. More...
 
void getModules (iconnect::StrVector &modules)
 Returns regex for module names (source files), which should be used as a source for symbols. More...
 
void getMustHaveAllTags (iconnect::StrVector &tags)
 Returns tags, which must be present in test specification to be executed.
 
void getMustHaveOneOfTags (iconnect::StrVector &tags)
 Returns tags, of which at least one must be present in test specification to be executed.
 
void getMustNotHaveAllTags (iconnect::StrVector &tags)
 Returns tags, which must NOT be present in test specification to be executed.
 
void getMustNotHaveOneOfTags (iconnect::StrVector &tags)
 Returns tags, of which at least one must NOT be present in test specification to be executed.
 
bool isOrTags1 ()
 Returns true, if the result of test for must have all tags is ANDed with other tests.
 
bool isOrTags2 ()
 Returns true, if the result of test for must have any of tags is ANDed with other tests.
 
bool isOrTags3 ()
 Returns true, if the result of test for must not have all tags is ANDed with other tests.
 
void getIncludedIds (iconnect::StrVector &ids)
 Returns the list of exception IDs. More...
 
void getExcludedIds (iconnect::StrVector &ids)
 Returns the list of exception IDs. More...
 
void getIncludedFunctions (iconnect::StrVector &functions)
 Returns the list of exception function names. More...
 
void getExcludedFunctions (iconnect::StrVector &functions)
 Returns the list of exception function names. More...
 
std::string getScriptFunction ()
 Returns script function, which performs filtering. More...
 
void getScriptFunctionParams (iconnect::StrVector &params)
 Returns the list of script function parameters.
 
void setFilterId (const std::string &filterId)
 Sets id of this filter.
 
void setFilterType (CTestFilter::EFilterTypes filterType)
 Sets type of filter performed.
 
void setMustHaveAllTags (const std::string &tags)
 Test specification must have all tags set with this method. More...
 
void setMustHaveOneOfTags (const std::string &tags)
 Test specification must have at least one of tags set with this method. More...
 
void setMustNotHaveAllTags (const std::string &tags)
 Test specification must not have any of tags set with this method. More...
 
void setMustNotHaveOneOfTags (const std::string &tags)
 Test specification must not have at least one of tags set with this method. More...
 
void setOrTags1 (bool isOr1)
 
void setOrTags2 (bool isOr2)
 
void setOrTags3 (bool isOr3)
 
void setIncludedIds (const std::string &ids)
 Test specification, which have test ID equal to one of the ids specified with this method, are added as an exception to the pool of executed test specifications. More...
 
void setExcludedIds (const std::string &ids)
 Test specification, which have test ID equal to one of the ids specified with this method, are removed as an exception from the pool of executed test specifications. More...
 
void setIncludedFunctions (const std::string &functions)
 Test specification, which have function name equal to one of the ids specified with this method, are added as an exception to the pool of executed test specifications. More...
 
void setExcludedFunctions (const std::string &functions)
 Test specification, which have function name equal to one of the ids specified with this method, are removed as an exception from the pool of executed test specifications. More...
 
void setScriptFunction (const std::string &functionName)
 Sets parameters for the script function.
 
void setScriptFunctionParams (const std::string &params)
 Returns the list of script function parameters.
 
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 Public Member Functions

static isys::CTestFilterSPtr cast (const CTestBaseSPtr &testBase)
 Casts the given object to this class. More...
 

Protected Member Functions

void setStaticTagsAsConst ()
 This method is called by all objects which are immediately contained in CTestSpecification, for example CTestCoverage, CTestHIL, ...
 

Member Enumeration Documentation

◆ EFilterTypes

Defines built-in and script filters.

Enumerator
BUILT_IN_FILTER 

filter algorithm implemented in this class is used

SCRIPT_FILTER 

filter algorithm implemented in user provided script is used

Constructor & Destructor Documentation

◆ CTestFilter()

isys::CTestFilter::CTestFilter ( const CTestBaseSPtr parent)
explicit

Initializes new instance.

Parameters
parentan instance of parent CTestBench class. Used only when parsing YAML declaration. Can be specified as NULL if the object is not initialized by parser.

Member Function Documentation

◆ cast()

static isys::CTestFilterSPtr isys::CTestFilter::cast ( const CTestBaseSPtr testBase)
static

Casts the given object to this class.

Returns NULL if input is NULL.

Exceptions
IllegalArgumentExceptionif input object is not instance of this class.

◆ getExcludedFunctions()

void isys::CTestFilter::getExcludedFunctions ( iconnect::StrVector functions)

Returns the list of exception function names.

See also
setExcludedFunctions

◆ getExcludedIds()

void isys::CTestFilter::getExcludedIds ( iconnect::StrVector ids)

Returns the list of exception IDs.

See also
setExcludedIds

◆ getIncludedFunctions()

void isys::CTestFilter::getIncludedFunctions ( iconnect::StrVector functions)

Returns the list of exception function names.

See also
setIncludedFunctions

◆ getIncludedIds()

void isys::CTestFilter::getIncludedIds ( iconnect::StrVector ids)

Returns the list of exception IDs.

See also
setIncludedIds

◆ getModules()

void isys::CTestFilter::getModules ( iconnect::StrVector modules)

Returns regex for module names (source files), which should be used as a source for symbols.

If this string is empty, all symbols from partition are used as filter input.

◆ getPartitions()

void isys::CTestFilter::getPartitions ( iconnect::StrVector partitions)

Returns regex for partition names (download file) where symbols are located.

If this item is empty string, symbols from all partitions in winIDEA project are used as filter input.

◆ getScriptFunction()

std::string isys::CTestFilter::getScriptFunction ( )

Returns script function, which performs filtering.

If the function returns null, test spec. is executed. If the function returns string, it is printed into test report, why the test spec. was not executed.

◆ setExcludedFunctions()

void isys::CTestFilter::setExcludedFunctions ( const std::string &  functions)

Test specification, which have function name equal to one of the ids specified with this method, are removed as an exception from the pool of executed test specifications.

If the same function name is in set also with the method setIncludedFunctions(), the inclusion takes precedence - test spec. is executed.

Parameters
functionsYAML list of strings, for example: "[myName1, myName2]"

◆ setExcludedIds()

void isys::CTestFilter::setExcludedIds ( const std::string &  ids)

Test specification, which have test ID equal to one of the ids specified with this method, are removed as an exception from the pool of executed test specifications.

If the same ID is in set also with the method setIncludedIds(), the inclusion takes precedence - test spec. is executed.

Parameters
idsYAML list of strings, for example: "[myName1, myName2]"

◆ setIncludedFunctions()

void isys::CTestFilter::setIncludedFunctions ( const std::string &  functions)

Test specification, which have function name equal to one of the ids specified with this method, are added as an exception to the pool of executed test specifications.

Parameters
functionsYAML list of strings, for example: "[myName1, myName2]"

◆ setIncludedIds()

void isys::CTestFilter::setIncludedIds ( const std::string &  ids)

Test specification, which have test ID equal to one of the ids specified with this method, are added as an exception to the pool of executed test specifications.

Note that test for function name is executed BEFORE the test for test ID.

Parameters
idsYAML list of strings, for example: "[myName1, myName2]"

◆ setMustHaveAllTags()

void isys::CTestFilter::setMustHaveAllTags ( const std::string &  tags)

Test specification must have all tags set with this method.

Parameters
tagsYAML list of strings, for example: "[myName1, myName2]"

◆ setMustHaveOneOfTags()

void isys::CTestFilter::setMustHaveOneOfTags ( const std::string &  tags)

Test specification must have at least one of tags set with this method.

Parameters
tagsYAML list of strings, for example: "[myName1, myName2]"

◆ setMustNotHaveAllTags()

void isys::CTestFilter::setMustNotHaveAllTags ( const std::string &  tags)

Test specification must not have any of tags set with this method.

Parameters
tagsYAML list of strings, for example: "[myName1, myName2]"

◆ setMustNotHaveOneOfTags()

void isys::CTestFilter::setMustNotHaveOneOfTags ( const std::string &  tags)

Test specification must not have at least one of tags set with this method.

Parameters
tagsYAML list of strings, for example: "[myName1, myName2]"

◆ setOrTags1()

void isys::CTestFilter::setOrTags1 ( bool  isOr1)
Parameters
isOr1if true, AND logical operation is applied between test for must have all tags and other tags tests.

◆ setOrTags2()

void isys::CTestFilter::setOrTags2 ( bool  isOr2)
Parameters
isOr2if true, AND logical operation is applied between test for must have any of tags and other tags tests.

◆ setOrTags3()

void isys::CTestFilter::setOrTags3 ( bool  isOr3)
Parameters
isOr3if true, AND logical operation is applied between test for must not have all tags and other tags tests.