@@@ much mess, mostly manpages
[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
52.\" @tvec_unkreg
53.\" @tvec_dupreg
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;"
83.B " struct tvec_config cfg;"
84.B " struct tvec_reg *in, *out;"
85.B " const struct tvec_test *test;"
86.B " ..."
87.B "};"
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 ..."
93.PP
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 );
101.ta 2n +\w'\fB('u
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 );
111.ta 2n
112.B "struct tvec_env {"
113.B " size_t ctxsz;"
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;"
120.B "};"
121.PP
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 );
127.PP
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 );
144.PP
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 ..."
152.PP
153.B "enum {"
154.B " TVLEV_NOTE = ...,"
155.B " TVLEV_ERR = ...,"
156.B " ..."
157.B "};"
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_unkreg(struct tvec_state *" tv ", const char *" name );
167.BI "int tvec_dupreg(struct tvec_state *" tv ", const char *" name );
168.PP
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 );
177.PP
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 );
181.fi