Motr  M0
module.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 #pragma once
22 #ifndef __MOTR_UT_MODULE_H__
23 #define __MOTR_UT_MODULE_H__
24 
25 #include "module/module.h"
26 #include "lib/atomic.h" /* m0_atomic64 */
27 
35 struct m0_ut_moddep {
36  struct m0_module *ud_module; /* XXX FIXME: Use enum m0_module_id. */
37  int ud_level;
38 };
39 
40 enum { M0_UT_SUITES_MAX = 1024 };
41 
42 struct m0_ut_module {
50  const char *ut_tests;
55  bool ut_exclude;
57  const char *ut_sandbox;
62  unsigned ut_suites_nr;
64 };
65 
67 enum {
77 };
78 
81 
82 /*
83  * m0_ut_suite m0_ut_module
84  * +-------------------------+ * 1 +---------------------+
85  * [<-----]| M0_LEVEL_UT_SUITE_READY |<-----| M0_LEVEL_UT_READY |
86  * +-------------------------+ +---------------------+
87  * | M0_LEVEL_UT_PREPARE |
88  * +---------------------+
89  */
90 /* XXX DELETEME */
91 M0_INTERNAL void m0_ut_suite_module_setup(struct m0_ut_suite *ts,
92  struct m0 *instance);
93 
94 /*
95  * m0_ut_module m0
96  * +---------------------+ +--------------------------+
97  * | M0_LEVEL_UT_READY |<-----| M0_LEVEL_INST_READY |
98  * +---------------------+ +--------------------------+
99  * | M0_LEVEL_UT_KLUDGE | ,--| M0_LEVEL_INST_SUBSYSTEMS |
100  * +---------------------+ | +--------------------------+
101  * | M0_LEVEL_UT_PREPARE |<--' | M0_LEVEL_INST_ONCE |
102  * +---------------------+ +--------------------------+
103  * | M0_LEVEL_INST_PREPARE |
104  * +--------------------------+
105  */
106 extern const struct m0_module_type m0_ut_module_type;
107 
109 #endif /* __MOTR_UT_MODULE_H__ */
const char * ut_tests
Definition: module.h:50
unsigned ut_suites_nr
Definition: module.h:62
const char * ut_sandbox
Definition: module.h:57
struct m0_ut_suite * ut_suites[M0_UT_SUITES_MAX]
Definition: module.h:61
bool ut_small_credits
Definition: module.h:60
struct m0_module ut_module
Definition: module.h:43
Definition: ut.h:77
bool ut_exclude
Definition: module.h:55
bool ut_keep_sandbox
Definition: module.h:59
Definition: instance.h:80
struct m0_module * ud_module
Definition: module.h:36
const struct m0_module_type m0_ut_module_type
Definition: module.c:37
int ud_level
Definition: module.h:37
static struct m0 instance
Definition: main.c:78
M0_INTERNAL void m0_ut_suite_module_setup(struct m0_ut_suite *ts, struct m0 *instance)
Definition: module.c:90
struct m0_atomic64 ut_asserts
Definition: module.h:63