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