Defines, Structures, Typedefs, Functions. More...
Files | |
file | clTcUtilsApi.h |
Header file for ASP Test Lifecycle Control (TLC) APIs. | |
file | clTestApi.h |
OpenClovis Test Infrastructure. |
Classes | |
struct | ClTcParamListT |
List to store all the parsed runtime configuration paramaters, by TLC. More... | |
struct | ClTcParamT |
Basic structure to store the parsed runtime configuration paramater, by TLC. More... | |
union | ClTcParamValU |
Union to store parsed runtime configuration paramater value, by TLC. More... |
Macros | |
#define | clTest(string, predicate, errorPrintf) |
Run an individual test. | |
#define | clTestCase(name, test) |
Run a test case. | |
#define | clTestCaseEnd(synopsis) |
Stop this test case. | |
#define | clTestCaseMalfunction(reason, predicate, execOnFailure) |
Indicate that this test case cannot be completed, if the predicate fails. | |
#define | clTestCaseNumErrors() clCurTc.failed |
Returns the number of errored (failed) tests run so far in this test case. | |
#define | clTestCaseNumMalfunctions() clCurTc.malfunction |
Return the number of malfunctioned tests in this test case (so far). | |
#define | clTestCaseNumPasses() clCurTc.passed |
Return the number of successful (passed) test run so far in this test case. | |
#define | clTestCaseStart(testname) |
Start a Test Case. | |
#define | clTestExecOnFailure(string, predicate, errorPrintf, execOnFailure) |
Run an individual test, and run some special code if it fails. | |
#define | clTestFailed(__string) clTestFailedAt(__FILE__, __LINE__,__string) |
Indicate that a test failed. | |
#define | clTestFailedAt(__file, __line, __string) |
Just like clTestFailed, but allows the caller to specify the file and line. | |
#define | clTestGroupFinalize() clTestGroupFinalizeImpl() |
Stop the Test infrastructure. | |
#define | clTestGroupInitialize(name) clTestPrint(name) |
Start up the Test infrastructure. | |
#define | clTestGroupMalfunction(reason, predicate, execOnFailure) |
Indicate that the Test Group cannot execute, if an expression evaluates to False. | |
#define | clTestPrint(x) clTestPrintAt(__FILE__, __LINE__, __FUNCTION__, x) |
Print something to the test console. | |
#define | clTestPrintAt(__file, __line, __function, x) |
Just like clTestPrint, but allows the caller to specify the file and line. | |
#define | clTestSuccess(__string) clTestSuccessAt(__FILE__, __LINE__, __string) |
Indicate that a test passed. | |
#define | clTestSuccessAt(__file, __line, __string) |
Just like clTestSuccess, but allows the caller to specify the file and line. | |
#define | TC_MAX_STR_LENGTH 256 |
Default size of all strings used within the TLC infrastructure. |
Typedefs | |
typedef struct ClTcParamListT | ClTcParamListT |
List to store all the parsed runtime configuration paramaters, by TLC. | |
typedef struct ClTcParamT | ClTcParamT |
Basic structure to store the parsed runtime configuration paramater, by TLC. | |
typedef enum ClTcParamTypeE | ClTcParamTypeE |
Current paramater types supported by TLC. | |
typedef union ClTcParamValU | ClTcParamValU |
Union to store parsed runtime configuration paramater value, by TLC. |
Enumerations | |
enum | ClTcParamTypeE |
Current paramater types supported by TLC. More... |
Functions | |
int | clTcActivate (ClAmsCSIDescriptorT *csi_desc, ClAmsHAStateT ha_state) |
API called to start the test case registered by the user in clTcInitialze. | |
void | clTcFinalize (void) |
Stop the Test Lifecyle Control (TLC) control loop. | |
int | clTcInitialize (const ClCharT *subsystem, const ClCharT *test_name, int(*func_to_register)(ClTcParamListT *param_list)) |
Initialize Test Lifecycle Control (TLC) infrastructure and register test case start function. | |
int | clTcParseConfigFile (ClCharT *file_path, ClCharT *file_name, ClCharT *subsystem_name, ClCharT *test_case_name, ClTcParamListT *param_list) |
Parse a file containing runtime paramaters for a test case. | |
int | clTcParseWorkLoad (ClAmsCSIDescriptorT *csi_desc, ClCharT *subsystem_name, ClCharT *test_case_name, ClTcParamListT *param_list) |
Wrapper function for clTcParsConfigFile, called with the AMF CSI descriptor. | |
void | clTcPrintParams (void) |
Print utility that prints the parsed runtime configuration parameters. | |
void | clTcRun (void) |
API called to activate Test Lifecycle Control (TLC) control loop. |
Defines, Structures, Typedefs, Functions.
#define clTest | ( | string, | |
predicate, | |||
errorPrintf | |||
) |
Run an individual test.
string | A parenthesized printf-style string that identifies this test |
predicate | An expression that evaluates to True if the test succeeded, False if it failed. |
errorPrintf | A parenthesized printf-style string that you would like printed if the predicate fails. There is no need to print "failed!", etc since this function will do that for you. |
#define clTestCase | ( | name, | |
test | |||
) |
Run a test case.
name | A parenthesized printf-style string describing the test case |
test | The test case code. Most likely a function call. |
#define clTestCaseEnd | ( | synopsis | ) |
Stop this test case.
synopsis | A parenthesized printf-style string that you would like printed and stored with the results of this test case run. Do not print counts of the number of passed, failed, or malfunctioned tests; The function already does that. |
#define clTestCaseMalfunction | ( | reason, | |
predicate, | |||
execOnFailure | |||
) |
Indicate that this test case cannot be completed, if the predicate fails.
reason | A parenthesized printf-style string describing why it cannot be completed. |
predicate | If this expression evaluates to true, it is a malfunction, otherwise it is not. |
execOnFailure | Run this code if there is a malfunction. |
#define clTestCaseNumErrors | ( | ) | clCurTc.failed |
Returns the number of errored (failed) tests run so far in this test case.
#define clTestCaseNumMalfunctions | ( | ) | clCurTc.malfunction |
Return the number of malfunctioned tests in this test case (so far).
#define clTestCaseNumPasses | ( | ) | clCurTc.passed |
Return the number of successful (passed) test run so far in this test case.
#define clTestCaseStart | ( | testname | ) |
Start a Test Case.
testname | A parenthesized printf-style string describing the test case |
#define clTestExecOnFailure | ( | string, | |
predicate, | |||
errorPrintf, | |||
execOnFailure | |||
) |
Run an individual test, and run some special code if it fails.
string | A parenthesized printf-style string that identifies this test |
predicate | An expression that evaluates to True if the test succeeded, False if it failed. |
errorPrintf | A parenthesized printf-style string that you would like printed if the predicate fails. There is no need to print "failed!", etc since this function will do that for you. |
execOnFailure | Run this code if the predicate is false. |
#define clTestFailed | ( | __string | ) | clTestFailedAt(__FILE__, __LINE__,__string) |
Indicate that a test failed.
__string | A parenthesized printf-style string that identifies this test |
#define clTestFailedAt | ( | __file, | |
__line, | |||
__string | |||
) |
Just like clTestFailed, but allows the caller to specify the file and line.
#define clTestGroupFinalize | ( | ) | clTestGroupFinalizeImpl() |
Stop the Test infrastructure.
#define clTestGroupInitialize | ( | name | ) | clTestPrint(name) |
Start up the Test infrastructure.
name | Identifies the test Service Group. Must be formatted in printf style i.e. ("name"). If you have more then one program in your SG, then give them different names with the same prefix. |
#define clTestGroupMalfunction | ( | reason, | |
predicate, | |||
execOnFailure | |||
) |
Indicate that the Test Group cannot execute, if an expression evaluates to False.
reason | A parenthesized printf-style string describing why the test group cannot be run. |
predicate | If this expression evaluates to true, it is a malfunction, otherwise it is not. |
execOnFailure | Run this code if there is a malfunction. |
\retval |
#define clTestPrint | ( | x | ) | clTestPrintAt(__FILE__, __LINE__, __FUNCTION__, x) |
Print something to the test console.
x | A parenthesized printf-style string that should be printed |
#define clTestPrintAt | ( | __file, | |
__line, | |||
__function, | |||
x | |||
) |
Just like clTestPrint, but allows the caller to specify the file and line.
#define clTestSuccess | ( | __string | ) | clTestSuccessAt(__FILE__, __LINE__, __string) |
Indicate that a test passed.
__string | A parenthesized printf-style string that identifies this test |
#define clTestSuccessAt | ( | __file, | |
__line, | |||
__string | |||
) |
Just like clTestSuccess, but allows the caller to specify the file and line.
typedef struct ClTcParamListT ClTcParamListT |
List to store all the parsed runtime configuration paramaters, by TLC.
The parsing routines will allocate an array of type ClTcParamT and store the parsed values into it.
typedef struct ClTcParamT ClTcParamT |
Basic structure to store the parsed runtime configuration paramater, by TLC.
The XML file that defines the runtime configuration parameters is parsed into this structure that defines the parameter name its type and the value. The interger id field is used as a short cut instead of strcmp within your code, you can use a switch() statement
typedef enum ClTcParamTypeE ClTcParamTypeE |
Current paramater types supported by TLC.
Each test case can define the runtime configuration parameters in an XML file, current limited to strings, integers and float types.
typedef union ClTcParamValU ClTcParamValU |
Union to store parsed runtime configuration paramater value, by TLC.
The XML file that defines the runtime configuration parameters is parsed into the union and the type set to indicate what type of parameter is stored.
enum ClTcParamTypeE |
Current paramater types supported by TLC.
Each test case can define the runtime configuration parameters in an XML file, current limited to strings, integers and float types.
int clTcActivate | ( | ClAmsCSIDescriptorT * | csi_desc, |
ClAmsHAStateT | ha_state | ||
) |
API called to start the test case registered by the user in clTcInitialze.
csi_desc | Pointer to ClAmsCSIDescriptorT structure sent by AMF during a HA state change. This is expected to contain the configuration file name and location. |
ha_state | Variable of type ClAmsHAStateT, used to store ha state, not needed by TLC but may be needed by application |
CL_OK | if successfull |
return | codes from clTcParseWorkLoad() |
void clTcFinalize | ( | void | ) |
Stop the Test Lifecyle Control (TLC) control loop.
None |
None |
int clTcInitialize | ( | const ClCharT * | subsystem, |
const ClCharT * | test_name, | ||
int(*)(ClTcParamListT *param_list) | func_to_register | ||
) |
Initialize Test Lifecycle Control (TLC) infrastructure and register test case start function.
subsystem_name | test case qualifier used by parser to search the configuration file to get to the appropriate subsystem |
test_case_name | test case qualifier used by parser to search the configuration file to get to the appropriate test case within the subsystem |
(*func_to_register)(ClTcParamListT | *param_list) function pointer to user function that runs the test case |
CL_OK | if all succeeds |
CL_ERR_INVALID_PARAMETER | if function pointer is NULL |
ASP | return codes if OSAL API calls fail |
The user is expected to call clTcRun() at the end of initialization phase in clCompAppInitialize() so that a forever loop is started.
When the state change to active is received, the user calls clTcActivate() which runs the test function registered with this
int clTcParseConfigFile | ( | ClCharT * | file_path, |
ClCharT * | file_name, | ||
ClCharT * | subsystem_name, | ||
ClCharT * | test_case_name, | ||
ClTcParamListT * | param_list | ||
) |
Parse a file containing runtime paramaters for a test case.
file_path | complete path to config file location on target |
file_name | config file name follows schema defined by clTcParamDef.xsd |
subsystem_name | test case qualifier used by parser to search the configuration file to get to the appropriate subsystem |
test_case_name | test case qualifier used by parser to search the configuration file to get to the appropriate test case within the subsystem |
CL_ERR_NULL_POINTER | file could not be opened by ezxml |
CL_ERR_NO_MEMORY | memory allocation failed |
CL_ERR_INVALID_PARAMETER | input argument(s) is/are invalid |
CL_ERR_DOESNT_EXIST | test case could not be found in config file |
CL_ERR_INVALID_BUFFER | general parsing error |
int clTcParseWorkLoad | ( | ClAmsCSIDescriptorT * | csi_desc, |
ClCharT * | subsystem_name, | ||
ClCharT * | test_case_name, | ||
ClTcParamListT * | param_list | ||
) |
Wrapper function for clTcParsConfigFile, called with the AMF CSI descriptor.
csi_desc | Pointer to ClAmsCSIDescriptorT structure sent by AMF during a HA state change. This is expected to contain the configuration file name and location. |
subsystem_name | test case qualifier used by parser to search the configuration file to get to the appropriate subsystem |
test_case_name | test case qualifier used by parser to search the configuration file to get to the appropriate test case within the subsystem |
CL_ERR_INVALID_PARAMETER | if input arguments are invalid |
see | return codes for clTcParseConfigFile() |
void clTcPrintParams | ( | void | ) |
Print utility that prints the parsed runtime configuration parameters.
None |
None |
void clTcRun | ( | void | ) |
API called to activate Test Lifecycle Control (TLC) control loop.
None |
None |