winIDEA SDK
|
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... | |
isys::CTestCase::CTestCase | ( | isys::ConnectionMgrSPtr & | connectionMgr | ) |
isys::CTestResultSPtr isys::CTestCase::getTestResults | ( | isys::CTestSpecificationSPtr & | testSpecification | ) |
Deprecated.
This method returns test result based on data stored internally in this class, including test specification.
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().
yamlSpec | test specification in YAML format. See User's guide for details. |
isDebug | if 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. |
void isys::CTestCase::itestCpp | ( | const std::string & | yamlSpec, |
iconnect::StrVector & | differences, | ||
bool | isDebug = false |
||
) |
Deprecated.
Return parameter differences contains only the most basic test results. Call getTestResult() to get complete information, including expression differences.
yamlSpec | YAML test spec. |
differences | after 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. |
isDebug | Debug. |
void isys::CTestCase::runTest | ( | isys::CTestSpecificationSPtr & | testSpec, |
iconnect::StrVector & | differences, | ||
bool | isDebug, | ||
const isys::CTestFilterSPtr & | testFilter | ||
) |
Deprecated.
Calls runTest() with infinite timeout.
void isys::CTestCase::runTest | ( | isys::CTestSpecificationSPtr & | testSpec, |
iconnect::StrVector & | differences, | ||
bool | isDebug = false |
||
) |
Deprecated.
Calls runTest() with empty test filter, which means the given test specification is not filtered - if not empty or abstract, it is executed.
void isys::CTestCase::runTest | ( | isys::CTestSpecificationSPtr & | testSpec, |
iconnect::StrVector & | differences, | ||
int | testTimeout, | ||
bool | isDebug, | ||
const isys::CTestFilterSPtr & | testFilter | ||
) |
Deprecated.
Return parameter differences contains only the most basic test results. Call getTestResult() to get complete information, including expression differences.
testSpec | Test specification. |
differences | after 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. |
testTimeout | Timeout. |
isDebug | Debug. |
testFilter | Test filters. |
void isys::CTestCase::runTest | ( | isys::CTestSpecificationSPtr & | testSpec, |
iconnect::StrVector & | differences, | ||
int | testTimeout, | ||
bool | isDebug, | ||
const isys::CTestFilterSPtr & | testFilter, | ||
const isys::CTestFilterControllerSPtr & | filterCtrl | ||
) |
Deprecated.
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.
testSpec | test specification to be executed |
testTimeout | test execution timeout in milliseconds. Value 0 means infinite timeout. |
isDebug | if 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. |
testFilter | if 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. |
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.
testSpec | test specification to be executed |
testTimeout | test execution timeout in milliseconds. Value 0 means infinite timeout. |
isDebug | if 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. |
testFilter | if 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(). |
filterCtrl | class used for performing filtering. If null, no filtering is performed. |