]> begriffs open source - cmsis-driver-validation/blob - Include/DV_Framework.h
Update GitHub Actions runner to ubuntu-22.04 (#18)
[cmsis-driver-validation] / Include / DV_Framework.h
1 /*
2  * Copyright (c) 2015-2020 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:       Test framework header file
22  *
23  * -----------------------------------------------------------------------------
24  */
25
26
27 #ifndef __CMSIS_DV_FRAMEWORK_H__
28 #define __CMSIS_DV_FRAMEWORK_H__
29
30 #include "DV_Typedefs.h"
31 #include "DV_Report.h"
32
33 /*-----------------------------------------------------------------------------
34  * Test framework global definitions
35  *----------------------------------------------------------------------------*/
36
37 /* Test case definition macro                                                 */
38 #define TCD(x, y) { (((y) != 0) ? (x) : (NULL)), #x }
39
40 /* Test case description structure                                            */
41 typedef struct {
42   void (*TestFunc)(void);             /* Test function                        */
43   const char *TFName;                 /* Test function name string            */
44 } const TEST_CASE;
45
46 /* Test group description structure                                           */
47 typedef struct {
48   const char *FileName;               /* Test module file name                */
49   const char *Date;                   /* Compilation date                     */
50   const char *Time;                   /* Compilation time                     */
51   const char *ReportTitle;            /* Title or name of module under test   */
52   void (*Init)(void);                 /* Init function callback               */
53   void (*Uninit)(void);               /* Uninit function callback             */
54
55   TEST_CASE *TC;                      /* Array of test cases                  */
56   uint32_t NumOfTC;                   /* Number of test cases (sz of TC array)*/
57
58 } const TEST_GROUP;
59
60 /* Defined in user test module                                                */
61 extern TEST_GROUP ts[];
62 extern uint32_t   tg_cnt;
63
64 #endif /* __CMSIS_DV_FRAMEWORK_H__ */