]> begriffs open source - cmsis-driver-validation/blob - Include/DV_Report.h
Update GitHub Actions runner to ubuntu-22.04 (#18)
[cmsis-driver-validation] / Include / DV_Report.h
1 /*
2  * Copyright (c) 2015-2021 Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * -----------------------------------------------------------------------------
19  *
20  * Project:     CMSIS-Driver Validation
21  * Title:       Report statistics and layout header file
22  *
23  * -----------------------------------------------------------------------------
24  */
25
26
27 #ifndef __CMSIS_DV_REPORT_H__
28 #define __CMSIS_DV_REPORT_H__
29
30 #include "DV_Typedefs.h"
31
32 /*-----------------------------------------------------------------------------
33  * Test report global definitions
34  *----------------------------------------------------------------------------*/
35  
36 /* Test case result definition */
37 typedef enum {
38   PASSED = 0,
39   FAILED,
40   NOT_EXECUTED
41 } TC_RES;
42
43 /* Test group statistics */
44 typedef struct {
45   uint32_t idx;                         /* Group index                        */
46   uint32_t tests;                       /* Total test cases count             */
47   uint32_t passed;                      /* Total test cases passed            */
48   uint32_t failed;                      /* Total test cases failed            */
49 } TEST_GROUP_RESULTS;
50
51 /* Test report interface */
52 typedef struct {
53   void (* tr_Init)    (void);
54   void (* tr_Uninit)  (void);
55   void (* tg_Init)    (const char *title, const char *date, const char *time, const char *file);
56   void (* tg_Info)    (const char *info);
57   void (* tg_InfoDone)(void);
58   void (* tg_Uninit)  (void);
59   void (* tc_Init)    (uint32_t num, const char *fn);
60   void (* tc_Detail)  (const char *module, uint32_t line, const char *message);
61   void (* tc_Uninit)  (void);
62   void (* as_Result)  (TC_RES res);
63 } REPORT_ITF;
64
65 /* Global structure for interfacing test report */
66 extern REPORT_ITF ritf;
67
68 extern void __tg_info    (const char *info);
69
70 /* Assertions and test results */
71 extern void __set_result (const char *module, uint32_t line, const char *message, TC_RES res);
72 extern void __set_message(const char *module, uint32_t line, const char *message);
73
74 #endif /* __CMSIS_DV_REPORT_H__ */