Add DeepState_TakeOver() interface
This commit is contained in:
@@ -309,6 +309,8 @@ struct DeepState_TestInfo {
|
||||
/* Pointer to the last registered `TestInfo` structure. */
|
||||
extern struct DeepState_TestInfo *DeepState_LastTestInfo;
|
||||
|
||||
extern int DeepState_TakeOver(void);
|
||||
|
||||
/* Defines the entrypoint of a test case. This creates a data structure that
|
||||
* contains the information about the test, and then creates an initializer
|
||||
* function that runs before `main` that registers the test entrypoint with
|
||||
|
||||
@@ -364,6 +364,19 @@ void DrMemFuzzFunc(volatile uint8_t *buff, size_t size) {
|
||||
}
|
||||
}
|
||||
|
||||
int DeepState_TakeOver(void) {
|
||||
struct DeepState_TestInfo test = {
|
||||
.prev = NULL,
|
||||
.test_func = NULL,
|
||||
.test_name = "<__TAKE_OVER_TEST>",
|
||||
.file_name = "<__TAKE_OVER_FILE>",
|
||||
.line_number = 0,
|
||||
};
|
||||
DeepState_Begin(&test);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Notify that we're about to begin a test while running under Dr. Fuzz. */
|
||||
void DeepState_BeginDrFuzz(struct DeepState_TestInfo *test) {
|
||||
DeepState_DrFuzzTest = test;
|
||||
|
||||
Reference in New Issue
Block a user