This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
deUnit_CallBack function
Unknown edited this page Jul 1, 2020
·
1 revision
In this mode it is possible to define callback functions for:
Serial print function: Is this callback function defined a google test like test result gets printed while testing
Test init: This function gets called after initiating the test suit and before executing the tests.
On each success: This function gets called on each successful executed Assert
On each failure: This function gets call on each failed Assert
At Test end: This function gets called after the test execution and receives as parameter if all test has been successful (true) Callback function are optional and do not require the getd defined.
To enable the callback functions set the “SELF_TEST_MODE” define to “1” To register each callback function use ; void addPrintFunction(int (*pPrint)(const char *fmt,...));
/**
* define a callback function that gets called at each failed Assert
* @param TestResult result of the failed test
*/
void addcallBackOnEachFail(void (*callBackOnEachFail)(TestResult *));
/**
* define a callback function that gets called on each successful Assert
*/
void addcallBackonEachSuccess( void (*callBackonEachSuccess)(void));
/**
* define a callback function that gets called while initialize the system
*/
void addcallBackOnTestInit( void (*callBackOnTestInit)(void));
/**
* define callback function that gets called on test end
* it gets true if all test had been successful and false if at least on test has failed
*/
void addcallBackOnTestExit( void (*callBackOnTestExit)(bool success));