diff --git a/src/include/deepstate/DeepState.h b/src/include/deepstate/DeepState.h index dd9f42f..121327f 100644 --- a/src/include/deepstate/DeepState.h +++ b/src/include/deepstate/DeepState.h @@ -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 diff --git a/src/lib/DeepState.c b/src/lib/DeepState.c index 14a428a..05b4b79 100644 --- a/src/lib/DeepState.c +++ b/src/lib/DeepState.c @@ -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;