@@@ man wip
[mLib] / test / tvec-env.3
1 .\" -*-nroff-*-
2 .de VS
3 .sp 1
4 .RS
5 .nf
6 .ft B
7 ..
8 .de VE
9 .ft R
10 .fi
11 .RE
12 .sp 1
13 ..
14 .de hP
15 .IP
16 .ft B
17 \h'-\w'\\$1\ 'u'\\$1\ \c
18 .ft P
19 ..
20 .ie t \{\
21 . ds o \(bu
22 . de VP
23 . sp .4v
24 ..
25 \}
26 .el \{\
27 . ds o o
28 . de VP
29 . sp
30 ..
31 \}
32 ..
33 .TH tvec-env 3 "11 March 2024" "Straylight/Edgeware" "mLib utilities library"
34 .SH NAME
35 tvec-env \- test vector framework environments
36 .\" @TVEG_GREG
37 .\" @TVEG_REG
38 .
39 .\" @tvec_skipgroup
40 .\" @tvec_skipgroup_v
41 .\" @tvec_skip
42 .\" @tvec_skip_v
43 .\" @tvec_fail
44 .\" @tvec_fail_v
45 .\" @tvec_dumpreg
46 .
47 .\" @tvec_checkregs
48 .\" @tvec_mismatch
49 .\" @tvec_check
50 .\" @tvec_check_v
51 .
52 .\" @tvec_report
53 .\" @tvec_report_v
54 .\" @tvec_error
55 .\" @tvec_notice
56 .\" @tvec_unkreg
57 .\" @tvec_dupreg
58 .
59 .\" @tvec_serialize
60 .\" @tvec_deserialize
61 .
62 .\" @tvec_initregs
63 .\" @tvec_releaseregs
64 .\" @tvec_releaseoutputs
65 .SH SYNOPSIS
66 .nf
67 .B "#include <mLib/tvec.h>"
68 .PP
69 .ta 2n
70 .B "enum {"
71 .B " TVRD_INPUT,"
72 .B " TVRD_OUTPUT,"
73 .B " TVRD_MATCH,"
74 .B " TVRD_FOUND,"
75 .B " TVRD_EXPECT,"
76 .B " TVRD_LIMIT"
77 .B "};"
78 .B "struct tvec_state {"
79 .B " unsigned f;"
80 .B " struct tvec_config cfg;"
81 .B " struct tvec_reg *in, *out;"
82 .B " const struct tvec_test *test;"
83 .B " ..."
84 .B "};"
85 .B "#define TVSF_SKIP ..."
86 .B "#define TVSF_ACTIVE ..."
87 .B "#define TVSF_OUTMASK ..."
88 .B "#define TVSF_OUTSHIFT ..."
89 .B "#define TVSF_XFAIL ..."
90 .PP
91 .ta \w'\fBtypedef int tvec_setvarfn('u
92 .BI "typedef int tvec_setvarfn(struct tvec_state *" tv ", const char *" var ,
93 .BI " const union tvec_regval *" rv ", void *" ctx );
94 .ta \w'\fBtypedef int tvec_envsetupfn('u
95 .BI "typedef void tvec_envsetupfn(struct tvec_state *" tv ,
96 .BI " const struct tvec_env *" env ,
97 .BI " void *" pctx ", void *" ctx );
98 .ta 2n +\w'\fB('u
99 .B "typedef const struct tvec_vardef *tvec_envfindvarfn"
100 .BI " (struct tvec_state *" tv ", const char *" name ,
101 .BI " void **" ctx_out ", void *" ctx );
102 .BI "typedef void tvec_envbeforefn(struct tvec_state *" tv ", void *" ctx );
103 .ta \w'\fBtypedef void tvec_envrunfn('u
104 .BI "typedef void tvec_envrunfn(struct tvec_state *" tv ,
105 .BI " tvec_testfn *" fn ", void *" ctx );
106 .BI "typedef void tvec_envafterfn(struct tvec_state *" tv ", void *" ctx );
107 .BI "typedef void tvec_envteardownfn(struct tvec_state *" tv ", void *" ctx );
108 .ta 2n
109 .B "struct tvec_env {"
110 .B " size_t ctxsz;"
111 .B " tvec_envsetupfn *setup;"
112 .B " tvec_envfindvarfn *findvar;"
113 .B " tvec_envbeforefn *before;"
114 .B " tvec_envrunfn *run;"
115 .B " tvec_envafterfn *after;"
116 .B " tvec_envteardownfn *teardown;"
117 .B "};"
118 .PP
119 .ta \w'\fBstruct tvec_reg *TVEC_GREG('u
120 .BI "struct tvec_reg *TVEC_GREG(struct tvec_reg *" vec ,
121 .BI " unsigned " i ", size_t " regsz );
122 .ta \w'\fBstruct tvec_reg *TVEC_REG('u
123 .BI "struct tvec_reg *TVEC_REG(struct tvec_state *" tv ", " vec ", unsigned " i );
124 .PP
125 .BI "void tvec_skipgroup(struct tvec_state *" tv ", const char *" excuse ", ...);"
126 .ta \w'\fBvoid tvec_skipgroup_v('u
127 .BI "void tvec_skipgroup_v(struct tvec_state *" tv ,
128 .BI " const char *" excuse ", va_list *" ap );
129 .BI "void tvec_skip(struct tvec_state *" tv ", const char *" excuse ", ...);"
130 .ta \w'\fBvoid tvec_skip_v('u
131 .BI "void tvec_skip_v(struct tvec_state *" tv ,
132 .BI " const char *" excuse ", va_list *" ap );
133 .BI "void tvec_fail(struct tvec_state *" tv ", const char *" detail ", ...);"
134 .ta \w'\fBvoid tvec_fail_v('u
135 .BI "void tvec_fail_v(struct tvec_state *" tv ,
136 .BI " const char *" detail ", va_list *" ap );
137 .ta \w'\fBvoid tvec_dumpreg('u
138 .BI "void tvec_dumpreg(struct tvec_state *" tv ,
139 .BI " unsigned " disp ", const union tvec_regval *" rv ,
140 .BI " const struct tvec_regdef *" rd );
141 .PP
142 .BI "void tvec_checkregs(struct tvec_state *" tv );
143 .BI "void tvec_mismatch(struct tvec_state *" tv ", unsigned " f );
144 .BI "void tvec_check(struct tvec_state *" tv ", const char *" detail ", ...);"
145 .ta \w'\fBvoid tvec_check_v('u
146 .BI "void tvec_check_v(struct tvec_state *" tv ,
147 .B "#define TVMF_IN ..."
148 .B "#define TVMF_OUT ..."
149 .PP
150 .B "enum {"
151 .B " TVLEV_NOTE = ...,"
152 .B " TVLEV_ERR = ...,"
153 .B " ..."
154 .B "};"
155 .ta \w'\fBvoid tvec_report('u
156 .BI "void tvec_report(struct tvec_state *" tv ", unsigned " level ,
157 .BI " const char *" msg ", ...);"
158 .ta \w'\fBvoid tvec_report_v('u
159 .BI "void tvec_report_v(struct tvec_state *" tv ", unsigned " level ,
160 .BI " const char *" msg ", va_list *" ap );
161 .BI "int tvec_error(struct tvec_state *" tv ", const char *" msg ", ...);"
162 .BI "void tvec_notice(struct tvec_state *" tv ", const char *" msg ", ...);"
163 .BI "int tvec_unkreg(struct tvec_state *" tv ", const char *" name );
164 .BI "int tvec_dupreg(struct tvec_state *" tv ", const char *" name );
165 .PP
166 .ta \w'\fBint tvec_serialize('u
167 .BI "int tvec_serialize(const struct tvec_reg *" rv ", buf *" b ,
168 .BI " const struct tvec_regdef *" regs ,
169 .BI " unsigned " nr ", size_t " regsz );
170 .ta \w'\fBint tvec_deserialize('u
171 .BI "int tvec_deserialize(struct tvec_reg *" rv ", buf *" b ,
172 .BI " const struct tvec_regdef *" regs ,
173 .BI " unsigned " nr ", size_t " regsz );
174 .PP
175 .BI "void tvec_initregs(struct tvec_state *" tv );
176 .BI "void tvec_releaseregs(struct tvec_state *" tv );
177 .BI "void tvec_releaseoutputs(struct tvec_state *" tv );
178 .fi