-
Notifications
You must be signed in to change notification settings - Fork 19
/
DV_Report.h
74 lines (63 loc) · 2.53 KB
/
DV_Report.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Copyright (c) 2015-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* -----------------------------------------------------------------------------
*
* Project: CMSIS-Driver Validation
* Title: Report statistics and layout header file
*
* -----------------------------------------------------------------------------
*/
#ifndef __CMSIS_DV_REPORT_H__
#define __CMSIS_DV_REPORT_H__
#include "DV_Typedefs.h"
/*-----------------------------------------------------------------------------
* Test report global definitions
*----------------------------------------------------------------------------*/
/* Test case result definition */
typedef enum {
PASSED = 0,
FAILED,
NOT_EXECUTED
} TC_RES;
/* Test group statistics */
typedef struct {
uint32_t idx; /* Group index */
uint32_t tests; /* Total test cases count */
uint32_t passed; /* Total test cases passed */
uint32_t failed; /* Total test cases failed */
} TEST_GROUP_RESULTS;
/* Test report interface */
typedef struct {
void (* tr_Init) (void);
void (* tr_Uninit) (void);
void (* tg_Init) (const char *title, const char *date, const char *time, const char *file);
void (* tg_Info) (const char *info);
void (* tg_InfoDone)(void);
void (* tg_Uninit) (void);
void (* tc_Init) (uint32_t num, const char *fn);
void (* tc_Detail) (const char *module, uint32_t line, const char *message);
void (* tc_Uninit) (void);
void (* as_Result) (TC_RES res);
} REPORT_ITF;
/* Global structure for interfacing test report */
extern REPORT_ITF ritf;
extern void __tg_info (const char *info);
/* Assertions and test results */
extern void __set_result (const char *module, uint32_t line, const char *message, TC_RES res);
extern void __set_message(const char *module, uint32_t line, const char *message);
#endif /* __CMSIS_DV_REPORT_H__ */