winIDEA SDK
isys::CTestCase Class Reference

Description

This class is the main class of the isystem.test framework.

It connects together classes with test specification and target controllers by providing methods for test execution.

Methods is itestCpp(), and runTest() execute test case, while method getTestResults() returns result.

Note: Wrappers for other languages, for example Python and Java, contain their replacement of this class.

Python example for class PTestCase, which replaces this class in Python.

#include <CTestCase.h>

Public Member Functions

 CTestCase (isys::ConnectionMgrSPtr &connectionMgr, isys::CTestHostVarsSPtr &hostvars)
 Initializes object with the given connection to winIDEA, and host variables.
 
 CTestCase (isys::ConnectionMgrSPtr &connectionMgr)
 
void itestCpp (const std::string &yamlSpec, bool isDebug=false)
 This method parses test specification given in YAML format, and then calls method runTest(). More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, int testTimeout, bool isDebug, const isys::CTestFilterSPtr &testFilter)
 Runs single test specification. More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, int testTimeout, bool isDebug, const isys::CTestFilterSPtr &testFilter, const isys::CTestFilterControllerSPtr &filterCtrl)
 Runs single test specification. More...
 
isys::CTestResultSPtr getTestResults ()
 This method returns test result based on data stored internally in this class, including test specification.
 
isys::CTestResultSPtr getTestResults (isys::CTestSpecificationSPtr &testSpecification)
 Deprecated. More...
 
void itestCpp (const std::string &yamlSpec, iconnect::StrVector &differences, bool isDebug=false)
 Deprecated. More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, iconnect::StrVector &differences, bool isDebug=false)
 Deprecated. More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, iconnect::StrVector &differences, bool isDebug, const isys::CTestFilterSPtr &testFilter)
 Deprecated. More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, iconnect::StrVector &differences, int testTimeout, bool isDebug, const isys::CTestFilterSPtr &testFilter)
 Deprecated. More...
 
void runTest (isys::CTestSpecificationSPtr &testSpec, iconnect::StrVector &differences, int testTimeout, bool isDebug, const isys::CTestFilterSPtr &testFilter, const isys::CTestFilterControllerSPtr &filterCtrl)
 Deprecated. More...
 

Constructor & Destructor Documentation

◆ CTestCase()

isys::CTestCase::CTestCase ( isys::ConnectionMgrSPtr connectionMgr)
Deprecated:
use CTestCase(ConnectionMgrSPtr, CTestHostVarsSPtr) instead Initializes object with the given connection to winIDEA.

Member Function Documentation

◆ getTestResults()

isys::CTestResultSPtr isys::CTestCase::getTestResults ( isys::CTestSpecificationSPtr &  testSpecification)

Deprecated.

Deprecated:
call getTestResults() without parameter instead

This method returns test result based on data stored internally in this class, including test specification.

◆ itestCpp() [1/2]

void isys::CTestCase::itestCpp ( const std::string &  yamlSpec,
bool  isDebug = false 
)

This method parses test specification given in YAML format, and then calls method runTest().

See also
runTest()
Parameters
yamlSpectest specification in YAML format. See User's guide for details.
isDebugif true, then test is not reset in case of error. If execution stops at user breakpoint, it is then possible to check variables and step through the code.

◆ itestCpp() [2/2]

void isys::CTestCase::itestCpp ( const std::string &  yamlSpec,
iconnect::StrVector differences,
bool  isDebug = false 
)

Deprecated.

Deprecated:
use itestCpp(yamlSpec, isDebug) instead.

Return parameter differences contains only the most basic test results. Call getTestResult() to get complete information, including expression differences.

Parameters
yamlSpecYAML test spec.
differencesafter return this vector contains a human readable evaluations of expressions from section assert, which evaluated to false, and values of variables used in the expressions.
isDebugDebug.

◆ runTest() [1/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
iconnect::StrVector differences,
bool  isDebug,
const isys::CTestFilterSPtr &  testFilter 
)

Deprecated.

Deprecated:
use runTest(testCase, testTimeout, isDebug, testFilter, filterCtrl) instead, create empty instance of testFilter with default ctor. CTestFilter().

Calls runTest() with infinite timeout.

◆ runTest() [2/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
iconnect::StrVector differences,
bool  isDebug = false 
)

Deprecated.

Deprecated:
use runTest(testCase, testTimeout, isDebug, testFilter, filterCtrl) instead, create empty instance of testFilter with default ctor. CTestFilter().

Calls runTest() with empty test filter, which means the given test specification is not filtered - if not empty or abstract, it is executed.

◆ runTest() [3/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
iconnect::StrVector differences,
int  testTimeout,
bool  isDebug,
const isys::CTestFilterSPtr &  testFilter 
)

Deprecated.

Deprecated:
use runTest(testCase, testTimeout, isDebug, testFilter, filterCtrl) instead, create empty instance of testFilter with default ctor. CTestFilter().

Return parameter differences contains only the most basic test results. Call getTestResult() to get complete information, including expression differences.

Parameters
testSpecTest specification.
differencesafter return this vector contains a human readable evaluations of expressions from section assert, which evaluated to false, and values of variables used in the expressions.
testTimeoutTimeout.
isDebugDebug.
testFilterTest filters.

◆ runTest() [4/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
iconnect::StrVector differences,
int  testTimeout,
bool  isDebug,
const isys::CTestFilterSPtr &  testFilter,
const isys::CTestFilterControllerSPtr &  filterCtrl 
)

Deprecated.

Deprecated:
use runTest(testCase, testTimeout, isDebug, testFilter, filterCtrl) instead

◆ runTest() [5/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
int  testTimeout,
bool  isDebug,
const isys::CTestFilterSPtr &  testFilter 
)

Runs single test specification.

It sets the environment on the target, calls the function to be tested, handles stubs, and finally verifies the result. Because of callbacks for init, end, and stub function, it can be used only if callbacks are implemented in C++. If any of these methods is specified in test specification (tags initFunc, endFunc, stub [func]), method setCallbackObject() must be called with non-NULL argument before this method.

Parameters
testSpectest specification to be executed
testTimeouttest execution timeout in milliseconds. Value 0 means infinite timeout.
isDebugif true, then test is not reset in case of error. If execution stops at user breakpoint, it is then possible to check variables and step through the code.
testFilterif not empty, test specification must match the condition specified by the filter to be executed. If empty, no filtering is performed and test spec is executed if not empty or abstract. Empty filter can be created with default ctor CTestFilter(). Note: Partition and module are not used for filtering. Call overload with CTestFilterController for complete filtering.

◆ runTest() [6/6]

void isys::CTestCase::runTest ( isys::CTestSpecificationSPtr &  testSpec,
int  testTimeout,
bool  isDebug,
const isys::CTestFilterSPtr &  testFilter,
const isys::CTestFilterControllerSPtr &  filterCtrl 
)

Runs single test specification.

It sets the environment on the target, calls the function to be tested, handles stubs, and finally verifies the result. Because of callbacks for init, end, and stub function, it can be used only if callbacks are implemented in C++. If any of these methods is specified in test specification (tags initFunc, endFunc, stub [func]), method setCallbackObject() must be called with non-NULL argument before this method.

Call getTestResults() after this method returns to get test results.

Parameters
testSpectest specification to be executed
testTimeouttest execution timeout in milliseconds. Value 0 means infinite timeout.
isDebugif true, then test is not reset in case of error. If execution stops at user breakpoint, it is then possible to check variables and step through the code.
testFilterif not empty, test specification must match the condition specified by the filter to be executed. If empty, no filtering is performed and test spec is executed if not empty or abstract. Empty filter can be created with default ctor CTestFilter().
filterCtrlclass used for performing filtering. If null, no filtering is performed.