1 /*-----------------------------------------------------------------------------
3 * Purpose: Test framework entry point
4 *----------------------------------------------------------------------------
5 * Copyright(c) KEIL - An ARM Company
6 *----------------------------------------------------------------------------*/
8 #include "DV_Framework.h"
10 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
12 \defgroup framework_funcs Framework Functions
13 \brief Functions in the Framework software component
19 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
21 \brief Close the debug session.
23 Debug session dead end - debug script should close session here. This function is called by \ref cmsis_dv.
25 void closeDebug(void);
26 void __attribute__((noinline)) closeDebug(void){
32 /*=======0=========1=========2=========3=========4=========5=========6=========7=========8=========9=========0=========1====*/
34 \brief This is the entry point of the test framework.
37 -# Hardware is first initialized if Init callback function is provided
38 -# Test report statistics is initialized
39 -# Test report headers are written to the standard output
40 -# All defined test cases are executed:
41 - Test case statistics is initialized
42 - Test case report header is written to the standard output
43 - Test case is executed
44 - Test case results are written to the standard output
45 - Test case report footer is written to the standard output
47 -# Test report footer is written to the standard output
48 -# Debug session ends in dead loop
50 void cmsis_dv (void __attribute__((unused)) *argument) {
56 ts.Init(); /* Init hardware */
59 ritf.Init (); /* Init test report */
60 ritf.Open (ts.ReportTitle, /* Write test report title */
61 ts.Date, /* Write compilation date */
62 ts.Time, /* Write compilation time */
63 ts.FileName); /* Write module file name */
65 /* Execute all test cases */
66 for (tc = 0; tc < ts.NumOfTC; tc++) {
67 no = ts.TCBaseNum+tc; /* Test case number */
68 fn = ts.TC[tc].TFName; /* Test function name string */
69 ritf.Open_TC (no, fn); /* Open test case #(Base + TC) */
71 ts.TC[tc].TestFunc(); /* Execute test case if enabled */
72 ritf.Close_TC (); /* Close test case */
74 ritf.Close (); /* Close test report */
76 closeDebug(); /* Close debug session */
82 // end of group framework_funcs