3 .\" Manual for test environments
5 .\" (c) 2024 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of the mLib utilities library.
12 .\" mLib is free software: you can redistribute it and/or modify it under
13 .\" the terms of the GNU Library General Public License as published by
14 .\" the Free Software Foundation; either version 2 of the License, or (at
15 .\" your option) any later version.
17 .\" mLib is distributed in the hope that it will be useful, but WITHOUT
18 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 .\" License for more details.
22 .\" You should have received a copy of the GNU Library General Public
23 .\" License along with mLib. If not, write to the Free Software
24 .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
27 .\"--------------------------------------------------------------------------
28 .so ../defs.man \" @@@PRE@@@
30 .\"--------------------------------------------------------------------------
31 .TH tvec-env 3mLib "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
60 .\" @tvec_releaseoutputs
62 .\"--------------------------------------------------------------------------
64 tvec-env \- test vector framework environments
66 .\"--------------------------------------------------------------------------
70 .B "#include <mLib/tvec.h>"
81 .B "struct tvec_state {"
83 .B " struct tvec_config cfg;"
84 .B " struct tvec_reg *in, *out;"
85 .B " const struct tvec_test *test;"
88 .B "#define TVSF_SKIP ..."
89 .B "#define TVSF_ACTIVE ..."
90 .B "#define TVSF_OUTMASK ..."
91 .B "#define TVSF_OUTSHIFT ..."
92 .B "#define TVSF_XFAIL ..."
94 .ta \w'\fBtypedef int tvec_setvarfn('u
95 .BI "typedef int tvec_setvarfn(struct tvec_state *" tv ", const char *" var ,
96 .BI " const union tvec_regval *" rv ", void *" ctx );
97 .ta \w'\fBtypedef int tvec_envsetupfn('u
98 .BI "typedef void tvec_envsetupfn(struct tvec_state *" tv ,
99 .BI " const struct tvec_env *" env ,
100 .BI " void *" pctx ", void *" ctx );
102 .B "typedef const struct tvec_vardef *tvec_envfindvarfn"
103 .BI " (struct tvec_state *" tv ", const char *" name ,
104 .BI " void **" ctx_out ", void *" ctx );
105 .BI "typedef void tvec_envbeforefn(struct tvec_state *" tv ", void *" ctx );
106 .ta \w'\fBtypedef void tvec_envrunfn('u
107 .BI "typedef void tvec_envrunfn(struct tvec_state *" tv ,
108 .BI " tvec_testfn *" fn ", void *" ctx );
109 .BI "typedef void tvec_envafterfn(struct tvec_state *" tv ", void *" ctx );
110 .BI "typedef void tvec_envteardownfn(struct tvec_state *" tv ", void *" ctx );
112 .B "struct tvec_env {"
114 .B " tvec_envsetupfn *setup;"
115 .B " tvec_envfindvarfn *findvar;"
116 .B " tvec_envbeforefn *before;"
117 .B " tvec_envrunfn *run;"
118 .B " tvec_envafterfn *after;"
119 .B " tvec_envteardownfn *teardown;"
122 .ta \w'\fBstruct tvec_reg *TVEC_GREG('u
123 .BI "struct tvec_reg *TVEC_GREG(struct tvec_reg *" vec ,
124 .BI " unsigned " i ", size_t " regsz );
125 .ta \w'\fBstruct tvec_reg *TVEC_REG('u
126 .BI "struct tvec_reg *TVEC_REG(struct tvec_state *" tv ", " vec ", unsigned " i );
128 .BI "void tvec_skipgroup(struct tvec_state *" tv ", const char *" excuse ", ...);"
129 .ta \w'\fBvoid tvec_skipgroup_v('u
130 .BI "void tvec_skipgroup_v(struct tvec_state *" tv ,
131 .BI " const char *" excuse ", va_list *" ap );
132 .BI "void tvec_skip(struct tvec_state *" tv ", const char *" excuse ", ...);"
133 .ta \w'\fBvoid tvec_skip_v('u
134 .BI "void tvec_skip_v(struct tvec_state *" tv ,
135 .BI " const char *" excuse ", va_list *" ap );
136 .BI "void tvec_fail(struct tvec_state *" tv ", const char *" detail ", ...);"
137 .ta \w'\fBvoid tvec_fail_v('u
138 .BI "void tvec_fail_v(struct tvec_state *" tv ,
139 .BI " const char *" detail ", va_list *" ap );
140 .ta \w'\fBvoid tvec_dumpreg('u
141 .BI "void tvec_dumpreg(struct tvec_state *" tv ,
142 .BI " unsigned " disp ", const union tvec_regval *" rv ,
143 .BI " const struct tvec_regdef *" rd );
145 .BI "void tvec_checkregs(struct tvec_state *" tv );
146 .BI "void tvec_mismatch(struct tvec_state *" tv ", unsigned " f );
147 .BI "void tvec_check(struct tvec_state *" tv ", const char *" detail ", ...);"
148 .ta \w'\fBvoid tvec_check_v('u
149 .BI "void tvec_check_v(struct tvec_state *" tv ,
150 .B "#define TVMF_IN ..."
151 .B "#define TVMF_OUT ..."
154 .B " TVLEV_NOTE = ...,"
155 .B " TVLEV_ERR = ...,"
158 .ta \w'\fBvoid tvec_report('u
159 .BI "void tvec_report(struct tvec_state *" tv ", unsigned " level ,
160 .BI " const char *" msg ", ...);"
161 .ta \w'\fBvoid tvec_report_v('u
162 .BI "void tvec_report_v(struct tvec_state *" tv ", unsigned " level ,
163 .BI " const char *" msg ", va_list *" ap );
164 .BI "int tvec_error(struct tvec_state *" tv ", const char *" msg ", ...);"
165 .BI "void tvec_notice(struct tvec_state *" tv ", const char *" msg ", ...);"
166 .BI "int tvec_unkregerr(struct tvec_state *" tv ", const char *" name );
167 .BI "int tvec_dupregerr(struct tvec_state *" tv ", const char *" name );
169 .ta \w'\fBint tvec_serialize('u
170 .BI "int tvec_serialize(const struct tvec_reg *" rv ", buf *" b ,
171 .BI " const struct tvec_regdef *" regs ,
172 .BI " unsigned " nr ", size_t " regsz );
173 .ta \w'\fBint tvec_deserialize('u
174 .BI "int tvec_deserialize(struct tvec_reg *" rv ", buf *" b ,
175 .BI " const struct tvec_regdef *" regs ,
176 .BI " unsigned " nr ", size_t " regsz );
178 .BI "void tvec_initregs(struct tvec_state *" tv );
179 .BI "void tvec_releaseregs(struct tvec_state *" tv );
180 .BI "void tvec_releaseoutputs(struct tvec_state *" tv );