|
@ -10,6 +10,7 @@ char* GlobalOrderError; |
|
|
/*=======External Functions This Runner Calls=====*/ |
|
|
/*=======External Functions This Runner Calls=====*/ |
|
|
extern void setUp(void); |
|
|
extern void setUp(void); |
|
|
extern void tearDown(void); |
|
|
extern void tearDown(void); |
|
|
|
|
|
extern void test_test1(void); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*=======Mock Management=====*/ |
|
|
/*=======Mock Management=====*/ |
|
@ -42,10 +43,39 @@ void verifyTest(void) |
|
|
CMock_Verify(); |
|
|
CMock_Verify(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*=======Test Runner Used To Run Each Test=====*/ |
|
|
|
|
|
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) |
|
|
|
|
|
{ |
|
|
|
|
|
Unity.CurrentTestName = name; |
|
|
|
|
|
Unity.CurrentTestLineNumber = line_num; |
|
|
|
|
|
#ifdef UNITY_USE_COMMAND_LINE_ARGS |
|
|
|
|
|
if (!UnityTestMatches()) |
|
|
|
|
|
return; |
|
|
|
|
|
#endif |
|
|
|
|
|
Unity.NumberOfTests++; |
|
|
|
|
|
UNITY_CLR_DETAILS(); |
|
|
|
|
|
UNITY_EXEC_TIME_START(); |
|
|
|
|
|
CMock_Init(); |
|
|
|
|
|
if (TEST_PROTECT()) |
|
|
|
|
|
{ |
|
|
|
|
|
setUp(); |
|
|
|
|
|
func(); |
|
|
|
|
|
} |
|
|
|
|
|
if (TEST_PROTECT()) |
|
|
|
|
|
{ |
|
|
|
|
|
tearDown(); |
|
|
|
|
|
CMock_Verify(); |
|
|
|
|
|
} |
|
|
|
|
|
CMock_Destroy(); |
|
|
|
|
|
UNITY_EXEC_TIME_STOP(); |
|
|
|
|
|
UnityConcludeTest(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/*=======MAIN=====*/ |
|
|
/*=======MAIN=====*/ |
|
|
int main(void) |
|
|
int main(void) |
|
|
{ |
|
|
{ |
|
|
UnityBegin("test_test.c"); |
|
|
UnityBegin("test_test.c"); |
|
|
|
|
|
run_test(test_test1, "test_test1", 15); |
|
|
|
|
|
|
|
|
return UnityEnd(); |
|
|
return UnityEnd(); |
|
|
} |
|
|
} |