-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-call.skeleton.cb
26 lines (19 loc) · 1.13 KB
/
test-call.skeleton.cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Call function @test_function_name()
// Variables:
// @ test_function_name: string, a function name that we should call. It contains a test that either fails or succeeds.
// (You will only see these variable names if you view test-call.skeleton.cb. If you view your generated test program source code, the variables are substituted with their corresponding values.)
// Prevent running the test call If a previous test has failed And If a setting orders us To do so.
If Upper(Str(CBUNIT_STOP_AT)) = "F"+"UNCTION" Then
If cbUnit_HasFailures Then cbUnit_EndProgram()
EndIf
// Hook for test_*.cb to do preparations.
cbUnit_SetCurrentContext("hook_SetupTest")
hook_SetupTest("@test_function_name")
// Call the actual test_*() function
cbUnit_SetCurrentContext("@test_function_name") // If failures happen, we will know under which test_*() Function they happened. Also applies to crashes (e.g. MAV).
@test_function_name()
// Hook for test_*.cb to do cleanup.
cbUnit_SetCurrentContext("hook_CleanupTest")
hook_CleanupTest("@test_function_name")
// Mark that we are now outside of any functions.
cbUnit_SetCurrentContext("")