• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*=======Test Runner Used To Run Each Test=====*/
2static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
3{
4    Unity.CurrentTestName = name;
5    Unity.CurrentTestLineNumber = line_num;
6#ifdef UNITY_USE_COMMAND_LINE_ARGS
7    if (!UnityTestMatches())
8        return;
9#endif
10    Unity.NumberOfTests++;
11    UNITY_CLR_DETAILS();
12    UNITY_EXEC_TIME_START();
13    CMock_Init();
14    if (TEST_PROTECT())
15    {
16<% if @options[:plugins].include?(:cexception) %>
17        CEXCEPTION_T e;
18        Try {
19            <%= @options[:setup_name] %>();
20            func();
21        } Catch(e) {
22            TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!");
23        }
24<% else %>
25        <%= @options[:setup_name] %>();
26        func();
27<% end %>
28    }
29    if (TEST_PROTECT())
30    {
31        <%= @options[:teardown_name] %>();
32        CMock_Verify();
33    }
34    CMock_Destroy();
35    UNITY_EXEC_TIME_STOP();
36    UnityConcludeTest();
37}
38